// src/app/reset-password/page.tsx
import { ResetPasswordForm } from "@/components/reset-password-form";

export default async function ResetPasswordPage({
  searchParams,
}: {
  // Next 16: searchParams is a Promise.
  searchParams: Promise<{ token?: string; error?: string }>;
}) {
  // Better Auth redirects here with ?token=… on success, or ?error=… (e.g.
  // INVALID_TOKEN) when the token is invalid or expired.
  const { token, error } = await searchParams;

  return (
    <div className="flex min-h-svh flex-col items-center justify-center bg-muted p-6 md:p-10">
      <div className="w-full max-w-sm">
        <ResetPasswordForm token={token} tokenError={error} />
      </div>
    </div>
  );
}
