import { Redirect } from 'expo-router';

import { useAuthStore } from '../src/stores';
import { hrefAuthWelcome, hrefHome } from '../src/navigation/hrefs';

export default function Index() {
  const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
  if (isAuthenticated) {
    return <Redirect href={hrefHome()} />;
  }
  return <Redirect href={hrefAuthWelcome()} />;
}
