import { useAtomValue } from 'jotai';
import { authTokenAtom, currentUserDetailsAtom } from '@/modules/auth/hooks/use-auth-hook';
import { WelcomeHero } from './components/welcome-hero';
import { AuthHero } from './components/auth-hero';

export function LandingPage() {
  const token = useAtomValue(authTokenAtom);
  const userData = useAtomValue(currentUserDetailsAtom);

  const isAuthenticated = token && userData;

  return (
    <div className='container mx-auto px-4 py-16'>
      <div className='max-w-4xl mx-auto text-center'>{isAuthenticated ? <WelcomeHero /> : <AuthHero />}</div>
    </div>
  );
}
