import { db } from "@/app/_lib/database";
import { Detail } from "./_components/Detail";

export const dynamic = "force-dynamic";

type Props = {
  params: { segment: string[] };
};

export default async function Page({ params: { segment } }: Props) {
  const id = segment?.[0];

  if (!id) return null;

  const row = await db
    .selectFrom("VoiceLine")
    .selectAll()
    .where("id", "=", id)
    .executeTakeFirst();

  if (!row) return null;

  return <Detail row={row} />;
}
