import { notFound } from "next/navigation";
import { getRow } from "@/lib/data";
import { TABLES } from "@/lib/appwrite-server";
import type { TestimonialRow } from "@/lib/types";
import { TestimonialForm } from "../../form";

export default async function EditTestimonialPage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const row = await getRow<TestimonialRow>(TABLES.testimonials, id);
  if (!row) notFound();
  return <TestimonialForm row={row} />;
}
