import React from 'react';
import { useSelector } from 'react-redux';
import { RootState } from '../store';
import { AuthStack } from './authStack';
import { AppStack } from './appStack';

export const RootNavigator: React.FC = () => {
  const { isAuthenticated, onboardingComplete } = useSelector(
    (state: RootState) => state.auth,
  );

  if (!isAuthenticated || !onboardingComplete) {
    return <AuthStack />;
  }

  return <AppStack />;
};
