/*
 * File: AppNavigator.tsx
 * Description: Root navigator switching between Auth and App stacks
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { useSelector } from 'react-redux';
import { selectIsAuthenticated } from '../modules/Auth/redux/authSelectors';
import AuthNavigator from './AuthNavigator';
import TabNavigator from './TabNavigator';
import { LoginScreen, SetupBiometricScreen } from '../modules/Auth/screens';
import { DashboardScreen } from '../modules/Dashboard/screens';

/**
 * AppNavigator - root navigator for the app
 * Shows Auth stack if not authenticated, TabNavigator if authenticated
 */
const AppNavigator: React.FC = () => {
  const isAuthenticated = useSelector(selectIsAuthenticated);
  return (
    <NavigationContainer >
      {isAuthenticated ? <TabNavigator /> : <AuthNavigator />}
    </NavigationContainer>
  );
};

export default AppNavigator;

/*
 * End of File: AppNavigator.tsx
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 