import { useSearch } from '@tanstack/react-router'
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@/components/ui/card'
import { AuthLayout } from '../auth-layout'
import { UserAuthForm } from './components/user-auth-form'

export function SignIn() {
  const { redirect } = useSearch({ from: '/(auth)/sign-in' })

  return (
    <AuthLayout>
      <Card className='gap-4 border-0 bg-transparent py-4 shadow-none'>
        <CardHeader className='gap-3'>
          <CardTitle className='text-2xl tracking-tight text-white'>
            Oturum Ac
          </CardTitle>
          <CardDescription className='text-white/50'>
            Yonetim paneline erismek icin hesap bilgilerinizi girin.
          </CardDescription>
        </CardHeader>
        <CardContent>
          <UserAuthForm redirectTo={redirect} />
        </CardContent>
        <CardFooter>
          <p className='px-2 text-center text-xs text-white/30'>
            Bu panel yalnizca yetkili personel icindir. Tum islemler kayit
            altina alinabilir.
          </p>
        </CardFooter>
      </Card>
    </AuthLayout>
  )
}
