Files
info-tager-mobile/app/index.tsx
Samandar Turgunboyev 124798419b fitst commit
2026-01-28 18:26:50 +05:00

22 lines
534 B
TypeScript

import { useAuth } from '@/components/AuthProvider';
import { Redirect } from 'expo-router';
import { ActivityIndicator, View } from 'react-native';
export default function Index() {
const { isAuthenticated, isLoading } = useAuth();
if (isLoading) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<ActivityIndicator size="large" />
</View>
);
}
if (isAuthenticated) {
return <Redirect href="/(dashboard)" />;
}
return <Redirect href="/(auth)" />;
}