import { Checkbox } from '@blueprintjs/core'; import { useToaster } from '../../context/ToasterContext.js'; import ActionButtons from '../../elements/ActionButtons.js'; import Label from '../../elements/Label.js'; import { NumberInput2Controller } from '../../elements/NumberInput2Controller.js'; import type { ApodizationFilterEntry } from '../../panels/filtersPanel/Filters/hooks/useApodization.js'; import { useApodization } from '../../panels/filtersPanel/Filters/hooks/useApodization.js'; import { headerLabelStyle } from '../Header.js'; import { HeaderWrapper } from '../HeaderWrapper.js'; interface BaseSimpleApodizationOptionsPanelProps { filter: ApodizationFilterEntry | null; } export function BaseSimpleApodizationOptionsPanel( props: BaseSimpleApodizationOptionsPanelProps, ) { const toaster = useToaster(); const { filter } = props; const { formMethods, submitHandler, handleApplyFilter, handleCancelFilter } = useApodization(filter, { applyFilterOnload: true, }); const { register, handleSubmit, control, formState: { isValid }, watch, } = formMethods; const isExponentialActive = watch('options.exponential.apply') || false; const { onChange: onLivePreviewFieldChange, ...livePreviewFieldOptions } = register('livePreview'); function handleClick() { if (!isExponentialActive) { toaster.show({ intent: 'danger', message: 'Activate "Exponential" filter from the Processing panel first', }); } } function handleConfirm() { void handleSubmit((values) => handleApplyFilter(values))(); } function handleCancel() { handleCancelFilter(); } return ( ); }