feat(convert): update CBR settings and fix input handling

- Renamed `data-testid` in `ConvertToCbrSettings` to `cbr-output-settings`
- Refined `onChange` handler in `ConvertToCbrSettings` to ensure valid numeric value
- Standardized quote style in `ConvertFromCbrSettings` imports

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
Balázs Szücs 2025-11-12 17:24:44 +01:00
parent ef7f7755be
commit af949d184d
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import { Stack, Text, Checkbox } from '@mantine/core';
import { useTranslation } from "react-i18next";
import { useTranslation } from 'react-i18next';
import { ConvertParameters } from "@app/hooks/tools/convert/useConvertParameters";
interface ConvertFromCbrSettingsProps {

View File

@ -16,17 +16,17 @@ const ConvertToCbrSettings = ({
const { t } = useTranslation();
return (
<Stack gap="sm" data-testid="cbr-output-options-section">
<Stack gap="sm" data-testid="cbr-output-settings">
<Text size="sm" fw={500}>{t("convert.cbrOutputOptions", "PDF to CBR Options")}:</Text>
<NumberInput
data-testid="cbr-dpi-input"
label={t("convert.cbrDpi", "DPI for image rendering")}
value={parameters.pdfToCbrOptions.dpi}
onChange={(value) => onParameterChange('pdfToCbrOptions', {
...parameters.pdfToCbrOptions,
dpi: typeof value === 'number' ? value : 150
})}
onChange={(val) =>
typeof val === 'number' &&
onParameterChange('pdfToCbrOptions', { ...parameters.pdfToCbrOptions, dpi: val })
}
min={72}
max={600}
step={50}