1import { SheetHeader } from "../../components/ui/SheetHeader";
2import { useNavigation } from "@react-navigation/native";
3import type { ReactNode } from "react";
4import { View } from "react-native";
5import { FitSheet } from "../../components/ui/FitSheet";
6
7export function PullRequestSheetContent(props: {
8 readonly title: string;
9 readonly subtitle: string;
10 readonly busy?: boolean;
11 readonly children: ReactNode;
12 readonly footer?: ReactNode;
13}) {
14 const navigation = useNavigation();
15 return (
16 <FitSheet
17 avoidsKeyboard
18 header={
19 <SheetHeader
20 title={props.title}
21 subtitle={props.subtitle}
22 onCancel={() => navigation.goBack()}
23 dismissDisabled={props.busy}
24 />
25 }
26 footer={props.footer}
27 keyboardShouldPersistTaps="handled"
28 contentContainerStyle={{ paddingHorizontal: 16, paddingTop: 16, paddingBottom: 20 }}
29 >
30 <View className="gap-4" pointerEvents={props.busy ? "none" : "auto"}>
31 {props.children}
32 </View>
33 </FitSheet>
34 );
35}