/** * Screen scaffold: token background, safe areas, and the app's standard * header (back affordance, display or compact title, optional status sub-row). * Screens own their headers for full design control — the router chrome is off. */ import { router } from "expo-router"; import type { ReactNode } from "react"; import { StyleSheet, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useTheme } from "../../theme/ThemeProvider"; import { space } from "../../theme/tokens"; import { Icon } from "./Icon"; import { Text } from "./Text"; import { Touchable } from "./Touchable"; export function Screen({ children }: { children: ReactNode }) { const { colors } = useTheme(); const insets = useSafeAreaInsets(); return ( {children} ); } interface HeaderProps { title: string; /** Large editorial title (list screens) vs compact (chat). */ large?: boolean; /** Sub-row under the title, e.g. agent identity + status. */ subtitle?: ReactNode; back?: boolean; onBack?: () => void; /** Right-side actions. */ trailing?: ReactNode; } export function Header({ title, large, subtitle, back, onBack, trailing, }: HeaderProps) { return ( {back ? ( router.back())} style={styles.back} > ) : null} {title} {subtitle} {trailing ? {trailing} : null} ); } const styles = StyleSheet.create({ root: { flex: 1 }, canvas: { flex: 1, width: "100%", maxWidth: 620, alignSelf: "center" }, header: { paddingHorizontal: space.gutter, paddingVertical: space.md }, headerLarge: { paddingTop: space.lg, paddingBottom: space.lg }, headerRow: { flexDirection: "row", alignItems: "center", gap: space.md }, back: { paddingHorizontal: space.xs, minWidth: 44, alignItems: "center" }, titleBlock: { flex: 1, gap: 2 }, trailing: { flexDirection: "row", alignItems: "center", gap: space.sm }, });