import type { ReactNode } from "react"; import { router } from "expo-router"; import { View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { IconButton } from "@/components/ui/Button"; import { Text } from "@/components/ui/Text"; import { colors, gutter } from "@/lib/theme"; type Props = { title?: string; subtitle?: string; /** Large left-aligned title, matching the "Explore Products" reference. */ large?: boolean; back?: boolean; onBack?: () => void; right?: ReactNode; background?: string; }; /** * Shared stack header. Back control and title share one row so they stay * vertically centered with each other (subtitle stacks under the title). */ export function AppHeader({ title, subtitle, large, back = true, onBack, right, background = "transparent", }: Props) { const insets = useSafeAreaInsets(); return ( {back ? ( router.back())} tone="surface" /> ) : null} {!large ? ( {title ? ( {title} ) : null} {subtitle ? ( {subtitle} ) : null} ) : ( )} {right ? ( {right} ) : null} {large && title ? ( {title} {subtitle ? ( {subtitle} ) : null} ) : null} ); }