mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
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:
parent
ef7f7755be
commit
af949d184d
@ -1,5 +1,5 @@
|
|||||||
import { Stack, Text, Checkbox } from '@mantine/core';
|
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";
|
import { ConvertParameters } from "@app/hooks/tools/convert/useConvertParameters";
|
||||||
|
|
||||||
interface ConvertFromCbrSettingsProps {
|
interface ConvertFromCbrSettingsProps {
|
||||||
|
|||||||
@ -16,17 +16,17 @@ const ConvertToCbrSettings = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
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>
|
<Text size="sm" fw={500}>{t("convert.cbrOutputOptions", "PDF to CBR Options")}:</Text>
|
||||||
|
|
||||||
<NumberInput
|
<NumberInput
|
||||||
data-testid="cbr-dpi-input"
|
data-testid="cbr-dpi-input"
|
||||||
label={t("convert.cbrDpi", "DPI for image rendering")}
|
label={t("convert.cbrDpi", "DPI for image rendering")}
|
||||||
value={parameters.pdfToCbrOptions.dpi}
|
value={parameters.pdfToCbrOptions.dpi}
|
||||||
onChange={(value) => onParameterChange('pdfToCbrOptions', {
|
onChange={(val) =>
|
||||||
...parameters.pdfToCbrOptions,
|
typeof val === 'number' &&
|
||||||
dpi: typeof value === 'number' ? value : 150
|
onParameterChange('pdfToCbrOptions', { ...parameters.pdfToCbrOptions, dpi: val })
|
||||||
})}
|
}
|
||||||
min={72}
|
min={72}
|
||||||
max={600}
|
max={600}
|
||||||
step={50}
|
step={50}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user