Files
Checkmate/client/src/hooks/forms/UseInitTeamsForm.tsx
T

18 lines
485 B
TypeScript
Raw Normal View History

2025-12-28 19:20:06 +00:00
import { teamSchema } from "@/validation";
2025-11-13 13:47:26 -08:00
import { useMemo } from "react";
import { z } from "zod";
export const useInitForm = ({
initialData,
}: {
initialData: Partial<z.infer<typeof teamSchema>> | undefined;
}) => {
return useMemo(() => {
const defaults: z.infer<typeof teamSchema> = {
name: initialData?.name || "",
description: initialData?.description || "",
roleId: initialData?.roleId || "",
};
return { defaults };
}, [initialData]);
};