"use client"; import { CloseButton, ColorInput, Stack, Switch, TextInput, useMantineTheme } from "@mantine/core"; import type { z } from "zod/v4"; import { useZodForm } from "@homarr/form"; import { createModal, ModalFormFooter, modalSizeForm } from "@homarr/modals"; import { useI18n } from "@homarr/translation/client"; import { TextMultiSelect } from "@homarr/ui"; import { containerSectionOptionsSchema } from "@homarr/validation/shared"; interface ModalProps { value: z.infer; onSuccessfulEdit: (value: z.infer) => void; } export const ContainerEditModal = createModal(({ actions, innerProps }) => { const tSection = useI18n("section"); const theme = useMantineTheme(); const form = useZodForm(containerSectionOptionsSchema.unwrap(), { mode: "controlled", initialValues: { ...innerProps.value }, }); return (
{ innerProps.onSuccessfulEdit(values); actions.closeModal(); })} > color[6])} rightSection={ form.setFieldValue("borderColor", "")} style={{ display: form.getInputProps("borderColor").value ? undefined : "none" }} /> } {...form.getInputProps("borderColor")} />
); }).withOptions({ defaultTitle(t) { return t("item.edit.title"); }, size: modalSizeForm, });