Slightly improve typing

This commit is contained in:
James 2025-08-12 14:39:08 +01:00
parent cbedb8e1ca
commit 4e2974b527

View File

@ -11,11 +11,11 @@ interface SanitizeSettingsProps {
const SanitizeSettings = ({ parameters, onParameterChange, disabled = false }: SanitizeSettingsProps) => { const SanitizeSettings = ({ parameters, onParameterChange, disabled = false }: SanitizeSettingsProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const options = Object.entries(defaultParameters).map(([key, value]) => ({ const options = (Object.keys(defaultParameters) as Array<keyof SanitizeParameters>).map((key) => ({
key: key as keyof SanitizeParameters, key: key,
label: t(`sanitize.options.${key}`, key), label: t(`sanitize.options.${key}`, key),
description: t(`sanitize.options.${key}.desc`, `${key} from the PDF`), description: t(`sanitize.options.${key}.desc`, `${key} from the PDF`),
default: value, default: defaultParameters[key],
})); }));
return ( return (