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

export default async function EditServicePage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const service = await getRow<ServiceRow>(TABLES.services, id);
  if (!service) notFound();
  return <ServiceForm service={service} />;
}
