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

export default async function EditTeamPage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const row = await getRow<TeamMemberRow>(TABLES.teamMembers, id);
  if (!row) notFound();
  return <TeamMemberForm row={row} />;
}
