import React from 'react'; import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { router } from 'expo-router'; import { AppColors, FontSizes, Spacing } from '@/constants/theme'; interface PageHeaderProps { title: string; onBack?: () => void; rightElement?: React.ReactNode; } export function PageHeader({ title, onBack, rightElement }: PageHeaderProps) { const handleBack = () => { if (onBack) { onBack(); } else { router.back(); } }; return ( {title} {rightElement || } ); } const styles = StyleSheet.create({ header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: Spacing.sm, paddingVertical: Spacing.md, backgroundColor: AppColors.background, borderBottomWidth: 1, borderBottomColor: AppColors.border, }, backButton: { width: 44, height: 44, justifyContent: 'center', alignItems: 'center', }, title: { flex: 1, fontSize: FontSizes.lg, fontWeight: '600', color: AppColors.textPrimary, textAlign: 'center', }, rightContainer: { width: 44, alignItems: 'flex-end', }, placeholder: { width: 44, }, });