import { View, Text, TouchableOpacity, ScrollView, Alert, StyleSheet } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' import { LogOut, CreditCard, Globe } from 'lucide-react-native' import { useAuthStore } from '@/lib/store' import { C } from '@/lib/theme' const TIER_LABELS: Record = { FREE: 'Gratuit', BASIC: 'Basic', PRO: 'Pro', BUSINESS: 'Business', ENTERPRISE: 'Enterprise', } export default function ProfileScreen() { const { user, logout } = useAuthStore() const initial = (user?.name?.[0] ?? user?.email?.[0] ?? '?').toUpperCase() const handleLogout = () => { Alert.alert( 'Se déconnecter', 'Voulez-vous vraiment vous déconnecter ?', [ { text: 'Annuler', style: 'cancel' }, { text: 'Déconnecter', style: 'destructive', onPress: logout }, ] ) } return ( Profil {initial} {user?.name ?? 'Utilisateur'} {user?.email} {user?.tier && ( {TIER_LABELS[user.tier] ?? user.tier} )} Abonnement Ouvrir memento-note.com Se déconnecter ) } const s = StyleSheet.create({ safe: { flex: 1, backgroundColor: C.paper }, title: { fontSize: 22, fontStyle: 'italic', fontWeight: '700', color: C.ink, paddingTop: 16, paddingBottom: 24 }, card: { backgroundColor: C.white, borderWidth: 1, borderColor: C.border, borderRadius: 20, padding: 20, marginBottom: 16 }, avatar: { width: 56, height: 56, borderRadius: 28, backgroundColor: '#f3ece4', alignItems: 'center', justifyContent: 'center', marginBottom: 12 }, avatarText: { fontSize: 22, fontWeight: '700', color: C.brand }, name: { fontSize: 17, fontWeight: '600', color: C.ink }, email: { fontSize: 13, color: C.concrete, marginTop: 2 }, badge: { marginTop: 12, alignSelf: 'flex-start', backgroundColor: '#f3ece4', paddingHorizontal: 12, paddingVertical: 4, borderRadius: 20 }, badgeText: { fontSize: 11, fontWeight: '800', color: C.brand, letterSpacing: 1, textTransform: 'uppercase' }, actionsCard: { backgroundColor: C.white, borderWidth: 1, borderColor: C.border, borderRadius: 20, overflow: 'hidden', marginBottom: 16 }, actionRow: { flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 16, paddingVertical: 14 }, actionRowBorder: { borderBottomWidth: 1, borderBottomColor: C.border }, actionText: { fontSize: 15, color: C.ink, flex: 1 }, logoutBtn: { backgroundColor: C.white, borderWidth: 1, borderColor: C.roseBorder, borderRadius: 20, flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 16, paddingVertical: 14 }, logoutText: { fontSize: 15, color: C.rose, fontWeight: '500' }, })