| 1 | import type { StaticScreenProps } from "@react-navigation/native"; |
| 2 | import { NativeStackScreenOptions } from "../../native/StackHeader"; |
| 3 | import { |
| 4 | addProjectRemoteSourceLabel, |
| 5 | parseAddProjectRemoteSource, |
| 6 | } from "@t3tools/client-runtime/operations/projects"; |
| 7 | |
| 8 | import { AddProjectRepositoryScreen } from "./AddProjectScreen"; |
| 9 | |
| 10 | type AddProjectRepositoryRouteParams = { |
| 11 | readonly environmentId?: string | string[]; |
| 12 | readonly source?: string | string[]; |
| 13 | }; |
| 14 | |
| 15 | export function AddProjectRepositoryRoute({ |
| 16 | route, |
| 17 | }: StaticScreenProps<AddProjectRepositoryRouteParams>) { |
| 18 | const params = route.params ?? {}; |
| 19 | const source = Array.isArray(params.source) ? params.source[0] : params.source; |
| 20 | const title = addProjectRemoteSourceLabel(parseAddProjectRemoteSource(source)); |
| 21 | |
| 22 | return ( |
| 23 | <> |
| 24 | <NativeStackScreenOptions options={{ title }} /> |
| 25 | <AddProjectRepositoryScreen {...params} /> |
| 26 | </> |
| 27 | ); |
| 28 | } |