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 py-4 shadow-none'>
        <CardHeader className='gap-3'>
          <div className='inline-flex w-fit items-center rounded-full bg-[#eef4fb] px-3 py-1 text-[11px] font-semibold tracking-[0.22em] text-[#3c5f90] uppercase'>
            Guvenli Giris
          </div>
          <CardTitle className='text-2xl tracking-tight text-[#102948]'>
            Yonetici girisi
          </CardTitle>
          <CardDescription>
            Personel, rol ve yonetim modullerine erismek icin yetkili
            hesabinizla oturum acin.
          </CardDescription>
        </CardHeader>
        <CardContent>
          <UserAuthForm redirectTo={redirect} />
        </CardContent>
        <CardFooter>
          <p className='px-2 text-center text-sm text-muted-foreground'>
            Bu panel yalnizca yetkili personel icindir. Tum islemler kayit
            altina alinabilir.
          </p>
        </CardFooter>
      </Card>
    </AuthLayout>
  )
}
