import { Stack, Text, Checkbox } from "@mantine/core"; import { useTranslation } from "react-i18next"; import NumberInputWithUnit from "../shared/NumberInputWithUnit"; import { RemoveBlanksParameters } from "../../../hooks/tools/removeBlanks/useRemoveBlanksParameters"; interface RemoveBlanksSettingsProps { parameters: RemoveBlanksParameters; onParameterChange: (key: K, value: RemoveBlanksParameters[K]) => void; disabled?: boolean; } const RemoveBlanksSettings = ({ parameters, onParameterChange, disabled = false }: RemoveBlanksSettingsProps) => { const { t } = useTranslation(); return ( onParameterChange('threshold', typeof v === 'string' ? Number(v) : v)} unit={t('removeBlanks.threshold.unit', '')} min={0} max={255} disabled={disabled} /> {t('removeBlanks.threshold.desc', "Threshold for determining how white a white pixel must be to be classed as 'White'. 0 = Black, 255 pure white.")} onParameterChange('whitePercent', typeof v === 'string' ? Number(v) : v)} unit={t('removeBlanks.whitePercent.unit', '%')} min={0.1} max={100} disabled={disabled} /> {t('removeBlanks.whitePercent.desc', "Percent of page that must be 'white' pixels to be removed")} onParameterChange('includeBlankPages', event.currentTarget.checked)} disabled={disabled} label={
{t('removeBlanks.includeBlankPages.label', 'Include detected blank pages')} {t('removeBlanks.includeBlankPages.desc', 'Include the detected blank pages as a separate PDF in the output')}
} />
); }; export default RemoveBlanksSettings;