import { Platform, SafeAreaView } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useHeaderHeight } from "@react-navigation/elements"; export default function CustomSafeAreaView({ children, edges = ["top", "bottom"], }: { children: React.ReactNode; edges?: ("top" | "bottom")[]; }) { const insets = useSafeAreaInsets(); const headerHeight = useHeaderHeight(); return ( 0 ? headerHeight : insets.top : undefined, paddingBottom: edges.includes("bottom") ? insets.bottom : undefined, }} > {children} ); }