import { Button, Group, Modal, TextInput, Title, type ModalBaseProps } from "@mantine/core"; import { t } from "@/config/i18n"; import { useForm } from "@mantine/form"; import { IconCancel, IconEdit, IconPlus } from "@tabler/icons-react"; import { type Contract, type ContractInputs } from "@/services/resources/contracts"; export type ContractModalProps = ModalBaseProps & { currentContract?: Contract; handleSubmit: (contract: ContractInputs, id?: number) => void; }; export function ContractModal({ opened, onClose, currentContract, handleSubmit, }: ContractModalProps) { const form = useForm({ // initialValues: { // firstname: currentContract?.firstname ?? "", // lastname: currentContract?.lastname ?? "", // email: currentContract?.email ?? "", // }, // validate: { // firstname: (value) => // !value ? `${t("name", { capfirst: true })} ${t("is required")}` : null, // email: (value) => // !value ? `${t("email", { capfirst: true })} ${t("is required")}` : null, // }, }); return ( {t("informations", { capfirst: true })} ); }