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

export default async function EditIndustryPage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const row = await getRow<IndustryRow>(TABLES.industries, id);
  if (!row) notFound();
  return <IndustryForm row={row} />;
}
