import { notFound } from "next/navigation";
import { getContainer } from "@/modules/garden/server/queries";
import { ContainerDetail } from "@/modules/garden/components/container-detail";
import { getShareLinksForEntity } from "@/modules/_core/share";

export default async function ContainerPage({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const [container, shareLinks] = await Promise.all([
    getContainer(id),
    getShareLinksForEntity("garden.container", id),
  ]);
  if (!container) notFound();
  return (
    <div className="page-content">
      <ContainerDetail container={container} shareLinks={shareLinks} />
    </div>
  );
}
