import React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { ActivityIndicator, View, StyleSheet } from 'react-native'; import { useAuth } from '../hooks/useAuth'; import { LoginScreen } from '../screens/LoginScreen'; import { SignupScreen } from '../screens/SignupScreen'; import { DashboardScreen } from '../screens/DashboardScreen'; import { TransactionScreen } from '../screens/TransactionScreen'; import { SubscriptionScreen } from '../screens/SubscriptionScreen'; import { AnalysisScreen } from '../screens/AnalysisScreen'; import { RootStackParamList, MainTabParamList } from '../types'; const Stack = createStackNavigator(); const Tab = createBottomTabNavigator(); const MainTabs = () => { return ( }} /> }} /> }} /> }} /> ); }; const TabIcon = ({ icon, color }: { icon: string; color: string }) => ( {icon} ); export const AppNavigator = () => { const { user, initializing } = useAuth(); if (initializing) { return ( ); } return ( {user ? ( ) : ( <> )} ); }; const styles = StyleSheet.create({ loadingContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F8F9FA' } });