feat(ui): new SettingsNotification using antd

This commit is contained in:
Fu Diwei
2024-12-20 13:56:29 +08:00
parent cae33cfc4f
commit 7c1a2d5f91
60 changed files with 1105 additions and 2450 deletions

View File

@@ -0,0 +1,26 @@
import { useTranslation } from "react-i18next";
import { Form, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
const NotifyChannelEditFormWebhookFields = () => {
const { t } = useTranslation();
const formSchema = z.object({
url: z
.string({ message: t("settings.notification.channel.form.webhook_url.placeholder") })
.min(1, t("settings.notification.channel.form.webhook_url.placeholder"))
.url({ message: t("common.errmsg.url_invalid") }),
});
const formRule = createSchemaFieldRule(formSchema);
return (
<div>
<Form.Item name="url" label={t("settings.notification.channel.form.webhook_url.label")} rules={[formRule]}>
<Input placeholder={t("settings.notification.channel.form.webhook_url.placeholder")} />
</Form.Item>
</div>
);
};
export default NotifyChannelEditFormWebhookFields;