import { UploadOutlined } from '@ant-design/icons'; import { Button, Divider, Input, InputNumber, Select, Space, Switch, Typography, } from 'antd'; import InputComponent from 'components/Input'; import TimePreference from 'components/TimePreferenceDropDown'; import { PANEL_TYPES } from 'constants/queryBuilder'; import GraphTypes from 'container/NewDashboard/ComponentsSlider/menuItems'; import useCreateAlerts from 'hooks/queryBuilder/useCreateAlerts'; import { Dispatch, SetStateAction, useCallback } from 'react'; import { Widgets } from 'types/api/dashboard/getAll'; import { panelTypeVsCreateAlert, panelTypeVsFillSpan, panelTypeVsPanelTimePreferences, panelTypeVsSoftMinMax, panelTypeVsThreshold, panelTypeVsYAxisUnit, } 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, softMax, softMin, setSoftMax, setSoftMin, }: RightContainerProps): JSX.Element { const onChangeHandler = useCallback( (setFunc: Dispatch>, value: string) => { setFunc(value); }, [], ); const selectedGraphType = GraphTypes.find((e) => e.name === selectedGraph)?.display || ''; const onCreateAlertsHandler = useCreateAlerts(selectedWidget); const allowThreshold = panelTypeVsThreshold[selectedGraph]; const allowSoftMinMax = panelTypeVsSoftMinMax[selectedGraph]; const allowFillSpans = panelTypeVsFillSpan[selectedGraph]; const allowYAxisUnit = panelTypeVsYAxisUnit[selectedGraph]; const allowCreateAlerts = panelTypeVsCreateAlert[selectedGraph]; const allowPanelTimePreference = panelTypeVsPanelTimePreferences[selectedGraph]; const softMinHandler = useCallback( (value: number | null) => { setSoftMin(value); }, [setSoftMin], ); const softMaxHandler = useCallback( (value: number | null) => { setSoftMax(value); }, [setSoftMax], ); return ( Panel Type Panel Attributes onChangeHandler(setTitle, event.target.value) } value={title} /> Description