import React from 'react'; import { Input } from 'UI'; import { Button, Form } from 'antd'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import { toast } from 'react-toastify'; import { TrashIcon } from 'lucide-react'; import { useTranslation } from 'react-i18next'; interface Props { onClose: () => void; onDelete: (id: string) => void; } function WebhookForm({ onClose, onDelete }: Props) { const { t } = useTranslation(); const { settingsStore } = useStore(); const { webhookInst: webhook, saveWebhook, editWebhook, saving, } = settingsStore; const write = ({ target: { value, name } }) => editWebhook({ [name]: value }); const save = () => { saveWebhook(webhook) .then(() => { onClose(); }) .catch((e) => { toast.error(e.message || t('Failed to save webhook')); }); }; return (
{webhook.exists() && }
{webhook.exists() && (
); } export default observer(WebhookForm);