// FormWrapper.tsx - Reusable wrapper untuk form dengan keyboard handling import { MainColor } from "@/constants/color-palet"; import { Keyboard, KeyboardAvoidingView, Platform, ScrollView, TouchableWithoutFeedback, View } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import { ReactNode } from "react"; import { useKeyboardForm } from "@/hooks/useKeyboardForm"; interface FormWrapperProps { children: ReactNode; footerComponent?: ReactNode; /** * Offset scroll saat keyboard muncul (default: 100) */ scrollOffset?: number; /** * Padding bottom untuk content (default: 100) */ contentPaddingBottom?: number; /** * Padding untuk content container (default: 16) */ contentPadding?: number; } export function FormWrapper({ children, footerComponent, scrollOffset = 100, contentPaddingBottom = 100, contentPadding = 16, }: FormWrapperProps) { const { scrollViewRef, handleInputFocus } = useKeyboardForm(scrollOffset); return ( {children} {/* Footer - Fixed di bawah */} {footerComponent && ( {footerComponent} )} ); }