import { translationAtom } from "@/atoms/translations-atom"; import { lensSizeAtom, viewTypeAtom } from "@/atoms/user-settings-atom"; import { cn } from "@/lib/utils"; import { useAtom, useAtomValue } from "jotai"; import { WrenchIcon } from "lucide-react"; import { useEffect, useState } from "react"; const ImageViewSettings = ({ zoomAmount, setZoomAmount, resetImagePaths, }: { zoomAmount: string; setZoomAmount: (arg: any) => void; resetImagePaths: () => void; }) => { const [openSidebar, setOpenSidebar] = useState(false); const [viewType, setViewType] = useAtom(viewTypeAtom); const [lensSize, setLensSize] = useAtom(lensSizeAtom); const t = useAtomValue(translationAtom); useEffect(() => { if (!localStorage.getItem("zoomAmount")) { localStorage.setItem("zoomAmount", zoomAmount); } else { setZoomAmount(localStorage.getItem("zoomAmount")); } }, []); return (
{t("APP.IMAGE_OPTIONS.LENS_VIEW_TITLE")}
{ setViewType(e.target.checked ? "slider" : "lens"); }} />{t("APP.IMAGE_OPTIONS.SLIDER_VIEW_TITLE")}
{t("APP.IMAGE_OPTIONS.ZOOM_AMOUNT_TITLE")} ({zoomAmount}%)
{ setZoomAmount(e.target.value); localStorage.setItem("zoomAmount", e.target.value); }} />{t("APP.IMAGE_OPTIONS.LENS_SIZE_TITLE")} ({lensSize / 10})
{ setLensSize(parseInt(e.target.value)); }} />