import { headers } from 'next/headers';
import { getThemeForPath } from '@/lib/theme';

export default async function LoginPage({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
  const sp = await searchParams;
  const h = await headers();
  const theme = await getThemeForPath(h.get('x-pathname') ?? '/login');
  const Login = theme.slots.LoginForm;
  return <Login error={sp.error ? '아이디 또는 비밀번호가 올바르지 않습니다.' : undefined} />;
}
