import React, { useCallback, useState } from 'react'; import { ActivityIndicator, ScrollView, StyleSheet, Text, View } from 'react-native'; import { useFocusEffect } from '@react-navigation/native'; import { ps } from '@/api/client'; import { useTheme } from '@/theme/ThemeContext'; import type { UserDetail } from 'parksmarter-client'; export function ProfileScreen() { const { colors } = useTheme(); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); useFocusEffect( useCallback(() => { setLoading(true); ps.getUserDetail() .then(setUser) .catch(() => setUser(null)) .finally(() => setLoading(false)); }, []), ); if (loading) { return ( ); } const Row = ({ label, value }: { label: string; value?: string | number }) => ( {label} {value ?? '—'} ); return ( ); } const styles = StyleSheet.create({ center: { flex: 1, alignItems: 'center', justifyContent: 'center' }, card: { borderRadius: 12, paddingHorizontal: 16 }, row: { flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 14, borderBottomWidth: StyleSheet.hairlineWidth, }, label: { fontSize: 14 }, value: { fontSize: 15, fontWeight: '600', maxWidth: '60%', textAlign: 'right' }, });