import { Form, FormInstance, Input, Select, Typography } from 'antd'; import FormItem from 'antd/lib/form/FormItem'; import { Store } from 'antd/lib/form/interface'; import ROUTES from 'constants/routes'; import { ChannelType, SlackChannel, } from 'container/CreateAlertChannels/config'; import history from 'lib/history'; import React from 'react'; import SlackSettings from './Settings/Slack'; import { Button } from './styles'; const { Option } = Select; const { Title } = Typography; function 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; onSaveHandler: (props: ChannelType) => void; savingState: boolean; NotificationElement: React.ReactElement< unknown, string | React.JSXElementConstructor >; title: string; initialValue: Store; nameDisable?: boolean; } FormAlertChannels.defaultProps = { nameDisable: undefined, }; export default FormAlertChannels;