30 lines
607 B
TypeScript
30 lines
607 B
TypeScript
"use client";
|
|||
|
|
|
||
|
|
import { useRouter } from "next/navigation";
|
||
|
|
|
||
|
|
import { BirthForm } from "@/app/profil/BirthForm";
|
||
|
|
import type { BirthData } from "@/lib/types";
|
||
|
|
|
||
|
|
export function EditPerson({
|
||
|
|
id,
|
||
|
|
name,
|
||
|
|
initial,
|
||
|
|
}: {
|
||
|
|
id: string;
|
||
|
|
name: string;
|
||
|
|
initial: BirthData & { placeName: string | null; region: string | null };
|
||
|
|
}) {
|
||
|
|
const router = useRouter();
|
||
|
|
return (
|
||
|
|
<BirthForm
|
||
|
|
initial={initial}
|
||
|
|
person={{ chartId: id, name }}
|
||
|
|
onCancel={() => router.push("/kepletek")}
|
||
|
|
onSaved={() => {
|
||
|
|
router.push(`/kepletek/${id}`);
|
||
|
|
router.refresh();
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
}
|