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

{t("SETTINGS.IMAGE_SCALE.TITLE")}{" "} ({scale}X)

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

!

)} ) : (

{t("SETTINGS.IMAGE_SCALE.TITLE")} ({scale}X){" "} {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} />
); }