import { Button, StyleSheet } from 'react-native';
import { View, Text } from 'react-native';
import { useAuth } from '../../../../context/AuthProvider';
import { useEffect } from 'react';

export default function Account() {
    const { user, logout } = useAuth();

    // useEffect(() => {
    //     console.log('two', user);
    // }, []);

    if (!user) return <Text>Loading...</Text>;

    return (
        <View
            style={{
                flex: 1,
                flexDirection: 'column',
                justifyContent: 'center',
                alignItems: 'center',
                paddingHorizontal: 4
            }}
        >
            <Text className="mb-8">Account PAGE</Text>
            <Text>{user?.username || 'No username'}</Text>
            <Button title="Log out" onPress={logout} />
        </View>
    );
}
