import React, { useState, useEffect } from 'react'; import { View, Text, TextInput, Button, StyleSheet } from 'react-native'; import { signOut } from 'firebase/auth'; import { doc, getDoc, updateDoc } from 'firebase/firestore'; import { auth, db } from '../config/firebase'; export default function ProfileScreen({ navigation }: any) { const [name, setName] = useState(''); useEffect(() => { loadProfile(); }, []); const loadProfile = async () => { const userDoc = await getDoc(doc(db, 'users', auth.currentUser!.uid)); setName(userDoc.data()?.name || ''); }; const handleSave = async () => { await updateDoc(doc(db, 'users', auth.currentUser!.uid), { name }); alert('Profil mentve'); }; const handleLogout = async () => { await signOut(auth); navigation.replace('Login'); }; return ( Profil