import { Redirect, Stack } from 'expo-router';
import { ActivityIndicator, StyleSheet, View } from 'react-native';
import { useAuth } from '../../lib/authContext';
import { colors } from '../../theme/colors';
export default function AppLayout() {
const { ready, session, userKeyState } = useAuth();
if (!ready) {
return (
);
}
if (!session) return ;
if (userKeyState.status === 'loading') {
return (
);
}
if (userKeyState.status === 'needs-setup') return ;
if (userKeyState.status === 'needs-unlock') return ;
return (
);
}
const styles = StyleSheet.create({
center: { flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: colors.bg },
});