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("APP.INFOS.IMAGE_SCALE.TITLE")}{" "} {t("APP.INFOS.IMAGE_SCALE.SCALES_TIMES", { scale, })}

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

!

)} ) : (

{t("APP.INFOS.IMAGE_SCALE.TITLE_CAPS")}{" "} {t("APP.INFOS.IMAGE_SCALE.SCALES_TIMES", { scale, })}{" "} {useCustomWidth && "DISABLED"}

)}
{!hideInfo && (

{t("APP.INFOS.IMAGE_SCALE.AI_UPSCALE_RESIZE_INFO")}

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

{t("APP.ERRORS.IMAGE_SCALE_WARN.PERF_ISSUE_DEVICE")}

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