import { useTranslation } from "react-i18next"; import { Form, type FormInstance, Input } from "antd"; import { createSchemaFieldRule } from "antd-zod"; import { z } from "zod"; import { validDomainName } from "@/utils/validators"; type DeployNodeConfigFormDogeCloudCDNConfigFieldValues = Nullish<{ domain: string; }>; export type DeployNodeConfigFormDogeCloudCDNConfigProps = { form: FormInstance; formName: string; disabled?: boolean; initialValues?: DeployNodeConfigFormDogeCloudCDNConfigFieldValues; onValuesChange?: (values: DeployNodeConfigFormDogeCloudCDNConfigFieldValues) => void; }; const initFormModel = (): DeployNodeConfigFormDogeCloudCDNConfigFieldValues => { return {}; }; const DeployNodeConfigFormDogeCloudCDNConfig = ({ form: formInst, formName, disabled, initialValues, onValuesChange, }: DeployNodeConfigFormDogeCloudCDNConfigProps) => { const { t } = useTranslation(); const formSchema = z.object({ domain: z .string({ message: t("workflow_node.deploy.form.dogecloud_cdn_domain.placeholder") }) .refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")), }); const formRule = createSchemaFieldRule(formSchema); const handleFormChange = (_: unknown, values: z.infer) => { onValuesChange?.(values); }; return (
} >
); }; export default DeployNodeConfigFormDogeCloudCDNConfig;