import { UploadOutlined } from '@ant-design/icons'; import { Button, Divider, Input, Select, Space, Switch, Typography, } from 'antd'; import InputComponent from 'components/Input'; import TimePreference from 'components/TimePreferenceDropDown'; import { QueryParams } from 'constants/query'; import { PANEL_TYPES } from 'constants/queryBuilder'; import ROUTES from 'constants/routes'; import GraphTypes from 'container/NewDashboard/ComponentsSlider/menuItems'; import history from 'lib/history'; import { Dispatch, SetStateAction, useCallback } from 'react'; import { Widgets } from 'types/api/dashboard/getAll'; import { panelTypeVsThreshold } from './constants'; import { Container, Title } from './styles'; import ThresholdSelector from './Threshold/ThresholdSelector'; import { ThresholdProps } from './Threshold/types'; import { timePreferance } from './timeItems'; import YAxisUnitSelector from './YAxisUnitSelector'; const { TextArea } = Input; const { Option } = Select; function RightContainer({ description, setDescription, setTitle, title, selectedGraph, setSelectedTime, selectedTime, yAxisUnit, setYAxisUnit, setGraphHandler, thresholds, setThresholds, selectedWidget, isFillSpans, setIsFillSpans, }: RightContainerProps): JSX.Element { const onChangeHandler = useCallback( (setFunc: Dispatch>, value: string) => { setFunc(value); }, [], ); const selectedGraphType = GraphTypes.find((e) => e.name === selectedGraph)?.display || ''; const onCreateAlertsHandler = useCallback(() => { if (!selectedWidget) return; history.push( `${ROUTES.ALERTS_NEW}?${QueryParams.compositeQuery}=${encodeURIComponent( JSON.stringify(selectedWidget?.query), )}`, ); }, [selectedWidget]); const allowThreshold = panelTypeVsThreshold[selectedGraph]; return ( Panel Type Panel Attributes onChangeHandler(setTitle, event.target.value) } value={title} /> Description