import { Button, Input, Select, Space, Tooltip, Typography } from 'antd'; import { ChartLine, CircleX } from 'lucide-react'; import { useMemo, useState } from 'react'; import { ThresholdItemProps } from './types'; function ThresholdItem({ threshold, updateThreshold, removeThreshold, showRemoveButton, channels, units, }: ThresholdItemProps): JSX.Element { const [showRecoveryThreshold, setShowRecoveryThreshold] = useState(false); const yAxisUnitSelect = useMemo(() => { let component = ( updateThreshold(threshold.id, 'unit', value)} style={{ width: 150 }} options={units} disabled={units.length === 0} /> ); } return component; }, [units, threshold.unit, updateThreshold, threshold.id]); return (
updateThreshold(threshold.id, 'label', e.target.value) } style={{ width: 260 }} /> updateThreshold(threshold.id, 'thresholdValue', e.target.value) } style={{ width: 210 }} /> {yAxisUnitSelect}
to updateThreshold(threshold.id, 'recoveryThresholdValue', e.target.value) } style={{ width: 210 }} /> )}
); } export default ThresholdItem;