import React from 'react'; import { Input } from 'UI'; import { Button, Form } from 'antd'; import styles from './webhookForm.module.css'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import { toast } from 'react-toastify'; function WebhookForm(props) { const { settingsStore } = useStore(); const { webhookInst: webhook, saveWebhook, editWebhook, saving } = settingsStore; const write = ({ target: { value, name } }) => editWebhook({ [name]: value }); const save = () => { saveWebhook(webhook) .then(() => { props.onClose(); }) .catch((e) => { toast.error(e.message || 'Failed to save webhook'); }); }; return (

{webhook.exists() ? 'Update' : 'Add'} Webhook

{webhook.exists() && }
{webhook.exists() && ( )}
); } export default observer(WebhookForm);