Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

draft.tsx

29 lines833 Bytes

1import { Stack, useLocalSearchParams } from "expo-router";
2​
3import { NewTaskDraftScreen } from "../../features/threads/NewTaskDraftScreen";
4​
5export default function NewTaskDraftRoute() {
6 const params = useLocalSearchParams<{
7 environmentId?: string | string[];
8 projectId?: string | string[];
9 title?: string | string[];
10 }>();
11​
12 return (
13 <>
14 <Stack.Screen
15 options={{
16 title: Array.isArray(params.title) ? params.title[0] : (params.title ?? "New task"),
17 }}
18 />
19 <NewTaskDraftScreen
20 initialProjectRef={{
21 environmentId: Array.isArray(params.environmentId)
22 ? params.environmentId[0]
23 : params.environmentId,
24 projectId: Array.isArray(params.projectId) ? params.projectId[0] : params.projectId,
25 }}
26 />
27 </>
28 );