import React from 'react'; import { View, Text, StyleSheet, ScrollView, Pressable, Alert } from 'react-native'; import { CompositeNavigationProp } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { BottomTabNavigationProp } from '@react-navigation/bottom-tabs'; import Ionicons from '@react-native-vector-icons/ionicons'; import Animated, { FadeInUp } from 'react-native-reanimated'; import { ScreenShell, Button } from '../../../components'; import { useTheme } from '../../../theme'; import { TAB_BAR_HEIGHT } from '../../../utils/layoutConstants'; import { useAppDispatch, useAppSelector } from '../../../app/hooks'; import type { AgentTabParamList, AgentProfileStackParamList } from '../navigation/agentNavigationTypes'; import { logoutSession } from '../../auth/store/authThunk'; type NavigationProp = CompositeNavigationProp< NativeStackNavigationProp, BottomTabNavigationProp >; export default function AgentProfileScreen({ navigation }: { navigation: NavigationProp }) { const theme = useTheme(); const dispatch = useAppDispatch(); const profile = useAppSelector(state => state.user.profile); const handleLogout = () => { Alert.alert( 'Log Out', 'Are you sure you want to log out of your agent account?', [ { text: 'Cancel', style: 'cancel' }, { text: 'Log Out', style: 'destructive', onPress: () => { dispatch(logoutSession()); } } ] ); }; const SettingsRow = ({ icon, label, onPress, destructive = false }: { icon: string, label: string, onPress: () => void, destructive?: boolean }) => ( {label} ); return ( {profile?.firstName?.charAt(0) || 'A'} {profile?.firstName} {profile?.lastName} Field Agent • {profile?.email} Active Agent Account Settings navigation.navigate('AgentChangePassword')} /> navigation.navigate('SmsHistory')} /> {}} /> Support & Legal {}} /> {}} />