import { Form, FormInstance, Input, Select, Typography } from 'antd';
import { Store } from 'antd/lib/form/interface';
import ROUTES from 'constants/routes';
import {
ChannelType,
PagerChannel,
PagerType,
SlackChannel,
SlackType,
WebhookChannel,
WebhookType,
} from 'container/CreateAlertChannels/config';
import history from 'lib/history';
import { Dispatch, ReactElement, SetStateAction } from 'react';
import { useTranslation } from 'react-i18next';
import PagerSettings from './Settings/Pager';
import SlackSettings from './Settings/Slack';
import WebhookSettings from './Settings/Webhook';
import { Button } from './styles';
const { Option } = Select;
const { Title } = Typography;
function FormAlertChannels({
formInstance,
type,
setSelectedConfig,
onTypeChangeHandler,
onTestHandler,
onSaveHandler,
savingState,
testingState,
title,
initialValue,
editing = false,
}: FormAlertChannelsProps): JSX.Element {
const { t } = useTranslation('channels');
const renderSettings = (): ReactElement | null => {
switch (type) {
case SlackType:
return