import { observer } from 'mobx-react-lite'; import React, { useEffect, useState } from 'react'; import { useVizStore } from '../../store'; import { useTranslation } from 'react-i18next'; import { ICreateField } from '../../interfaces'; import { Dialog, DialogContent, DialogFooter } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { Input } from '@/components/ui/input'; const FieldScalePanel: React.FC = (props) => { const vizStore = useVizStore(); const { showBinSettingPanel, setShowBinSettingPanel } = vizStore; const { t } = useTranslation(); const [chosenOption, setChosenOption] = useState<'widths' | 'counts'>('widths'); const [value, setValue] = useState(''); const options = ['widths', 'counts']; useEffect(() => { setChosenOption('widths'); setValue(''); }, [showBinSettingPanel]); return ( { setShowBinSettingPanel(false); }} >

{t('calc.bin_panel_title')}

{t('calc.bin_panel_desc')}

setChosenOption(opt as typeof chosenOption)} className="mt-2 gap-1 flex flex-col justify-center items-start" > {options.map((option, index) => { return (
{chosenOption === option && (
{ setValue(e.target.value); }} />
)}
); })}
); }; export default observer(FieldScalePanel);