import { translationAtom } from "@/atoms/translations-atom"; import { lensSizeAtom, viewTypeAtom } from "@/atoms/userSettingsAtom"; import { cn } from "@/lib/utils"; import { useAtom, useAtomValue } from "jotai"; import { WrenchIcon } from "lucide-react"; import { useEffect, useState } from "react"; const ImageOptions = ({ zoomAmount, setZoomAmount, resetImagePaths, hideZoomOptions, }: { zoomAmount: string; setZoomAmount: (arg: any) => void; resetImagePaths: () => void; hideZoomOptions?: boolean; }) => { 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)); }} />