import type { Metadata } from "next";

import { BirthTimeReconstructionResultView } from "@/features/birth-time-reconstruction/BirthTimeReconstructionResultView";

type PageProps = { params: Promise<{ id: string }> };

export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
  const { id } = await params;
  return {
    title: "Kết quả gợi ý giờ",
    description: `Mã tham chiếu ${id.slice(0, 8)}… — gợi ý khung giờ sinh sơ bộ.`,
  };
}

export default async function BirthTimeReconstructionResultPage({ params }: PageProps) {
  const { id } = await params;
  return (
    <main className="ctkp-fade-in-slow ctkp-result-canvas relative flex flex-1 flex-col overflow-x-hidden">
      <div className="relative z-[1] mx-auto w-full min-w-0 max-w-xl flex-1 px-4 py-14 sm:px-8 sm:py-20 md:max-w-2xl">
        <BirthTimeReconstructionResultView id={id} />
      </div>
    </main>
  );
}
