import { View, Text, StyleSheet, TouchableOpacity, Alert, Image } from "react-native"; import { useAuthStore } from "../../src/store"; import { Ionicons } from "@expo/vector-icons"; import { supabase } from "../../src/lib/supabase"; export default function ProfileScreen() { const { user, partner, signOut, fetchCouple } = useAuthStore(); const handleUnpair = async () => { Alert.alert( "Unpair Partner", "Are you sure you want to unpair? This cannot be undone.", [ { text: "Cancel", style: "cancel" }, { text: "Unpair", style: "destructive", onPress: async () => { try { await supabase.functions.invoke("manage-couple", { method: "DELETE", }); await fetchCouple(); // Refresh state } catch (error) { Alert.alert("Error", "Failed to unpair"); } }, }, ] ); }; return ( Profile {user?.name?.[0]?.toUpperCase() || "U"} {user?.name || "User"} {user?.email} Relationship {partner ? ( Paired with {partner.name || partner.email || 'your partner'} ) : ( Not paired yet )} Settings Sign Out Sauci v1.0.0 ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#1a1a2e", }, header: { paddingTop: 60, paddingHorizontal: 24, paddingBottom: 24, borderBottomWidth: 1, borderBottomColor: "#16213e", }, title: { fontSize: 28, fontWeight: "bold", color: "#fff", }, content: { padding: 24, }, profileCard: { alignItems: "center", marginBottom: 40, }, avatar: { width: 80, height: 80, borderRadius: 40, backgroundColor: "#e94560", justifyContent: "center", alignItems: "center", marginBottom: 16, }, avatarText: { fontSize: 32, fontWeight: "bold", color: "#fff", }, name: { fontSize: 24, fontWeight: "bold", color: "#fff", marginBottom: 4, }, email: { fontSize: 14, color: "#666", }, sectionTitle: { fontSize: 14, fontWeight: "600", color: "#666", marginBottom: 8, marginLeft: 4, textTransform: "uppercase", }, section: { backgroundColor: "#16213e", borderRadius: 12, marginBottom: 24, overflow: "hidden", }, row: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", padding: 16, borderBottomWidth: 1, borderBottomColor: "#1a1a2e", }, partnerInfo: { flexDirection: "row", alignItems: "center", gap: 12, }, rowText: { fontSize: 16, color: "#fff", }, version: { textAlign: "center", color: "#666", fontSize: 12, marginTop: 24, }, });