import { notFound } from "next/navigation";
import { ListDetail } from "@/modules/lists/components/list-detail";
import { getList } from "@/modules/lists/server/queries";

export default async function ListPage({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const list = await getList(id).catch(() => null);
  if (!list) notFound();

  return <ListDetail initialList={list} />;
}
