import {Button, Form, FormInstance, Input, Select, Space} from "antd"; import {t} from "ttag"; import {ApiOutlined, MinusCircleOutlined, PlusOutlined, ThunderboltFilled} from "@ant-design/icons"; import React from "react"; import {EventAction} from "../../utils/api"; import {Connector} from "../../utils/api/connectors"; const formItemLayout = { labelCol: { xs: {span: 24}, sm: {span: 4}, }, wrapperCol: { xs: {span: 24}, sm: {span: 20}, }, }; const formItemLayoutWithOutLabel = { wrapperCol: { xs: {span: 24, offset: 0}, sm: {span: 20, offset: 4}, }, }; export function WatchlistForm({form, connectors, onCreateWatchlist}: { form: FormInstance, connectors: (Connector & { id: string })[] onCreateWatchlist: (values: { domains: string[], triggers: { event: string, action: string }[] }) => void }) { const triggerEventItems: { label: string, value: EventAction }[] = [ { label: t`When a domain is expired`, value: 'expiration' }, { label: t`When a domain is deleted`, value: 'deletion' }, { label: t`When a domain is updated`, value: 'last changed' }, { label: t`When a domain is transferred`, value: 'transfer' }, { label: t`When a domain is locked`, value: 'locked' }, { label: t`When a domain is unlocked`, value: 'unlocked' }, { label: t`When a domain is reregistered`, value: 'reregistration' }, { label: t`When a domain is reinstantiated`, value: 'reinstantiation' }, { label: t`When a domain is registered`, value: 'registration' } ] const triggerActionItems = [ { label: t`Send me an email`, value: 'email' } ] return