import { Form, FormInstance, Input, Select, Typography } from 'antd'; import FormItem from 'antd/lib/form/FormItem'; import { ChannelType, SlackChannel, } from 'container/CreateAlertChannels/config'; import React from 'react'; const { Option } = Select; const { Title } = Typography; import ROUTES from 'constants/routes'; import history from 'lib/history'; import { Store } from 'rc-field-form/lib/interface'; import SlackSettings from './Settings/Slack'; import { Button } from './styles'; const FormAlertChannels = ({ formInstance, type, setSelectedConfig, onTypeChangeHandler, onTestHandler, onSaveHandler, savingState, NotificationElement, title, initialValue, nameDisable = false, }: FormAlertChannelsProps): JSX.Element => { return ( <> {NotificationElement} {title}
{ setSelectedConfig((state) => ({ ...state, name: event.target.value, })); }} /> {type === 'slack' && ( )} {/* */}
); }; interface FormAlertChannelsProps { formInstance: FormInstance; type: ChannelType; setSelectedConfig: React.Dispatch>>; onTypeChangeHandler: (value: ChannelType) => void; onTestHandler: () => void; onSaveHandler: (props: ChannelType) => void; savingState: boolean; NotificationElement: React.ReactElement< any, string | React.JSXElementConstructor >; title: string; initialValue: Store; nameDisable?: boolean; } export default FormAlertChannels;