import { notFound } from "next/navigation";
import { getRow } from "@/lib/data";
import { TABLES } from "@/lib/appwrite-rest";
import type { ProjectRow } from "@/lib/types";
import { ProjectForm } from "../../form";

export default async function EditProjectPage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const project = await getRow<ProjectRow>(TABLES.projects, id);
  if (!project) notFound();
  return <ProjectForm project={project} />;
}
