// app/login/page.tsx
'use client';

import { signIn } from 'next-auth/react';
import { useSearchParams } from 'next/navigation';
import LoginForm from '@/components/auth/LoginForm';

export default function LoginPage() {
  const searchParams = useSearchParams();
  const callbackUrl = searchParams?.get('callbackUrl') ?? '/dashboard';

  return (
    <LoginForm
      showSocialLogin={false}
      onSubmit={async ({ email, password }) => {
        await signIn('credentials', {
          email,
          password,
          callbackUrl,
        });
      }}
    />
  );
}
