import { translationAtom } from "@/atoms/translations-atom"; import { useCustomWidthAtom } from "@/atoms/userSettingsAtom"; import { useAtomValue } from "jotai"; type ImageScaleSelectProps = { scale: string; setScale: React.Dispatch>; hideInfo?: boolean; }; export function ImageScaleSelect({ scale, setScale, hideInfo, }: ImageScaleSelectProps) { const useCustomWidth = useAtomValue(useCustomWidthAtom); const t = useAtomValue(translationAtom); return (
{hideInfo ? ( <>

{t("SETTINGS.IMAGE_SCALE.TITLE")}{" "} {t("SETTINGS.IMAGE_SCALE.IMAGE_SCALED_BY", { scale, })}

{hideInfo && parseInt(scale) >= 6 && (

!

)} ) : (

{t("SETTINGS.IMAGE_SCALE.TITLE")}{" "} {t("SETTINGS.IMAGE_SCALE.IMAGE_SCALED_BY", { scale, })}{" "} {useCustomWidth && "DISABLED"}

)}
{!hideInfo && (

{t("SETTINGS.IMAGE_SCALE.DESCRIPTION")}

)} {!hideInfo && parseInt(scale) >= 6 && (

{t("SETTINGS.IMAGE_SCALE.ADDITIONAL_WARNING")}

)} { setScale(e.target.value.toString()); }} step="1" className="range range-primary mt-2" disabled={useCustomWidth} />
); }