import { lensSizeAtom, viewTypeAtom } from "@/atoms/userSettingsAtom"; import SidebarClosed from "@/components/icons/SidebarClosed"; import SidebarOpened from "@/components/icons/SidebarOpened"; import { useAtom } from "jotai"; import React, { 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); useEffect(() => { if (!localStorage.getItem("zoomAmount")) { localStorage.setItem("zoomAmount", zoomAmount); } else { setZoomAmount(localStorage.getItem("zoomAmount")); } }, []); return (
{ e.stopPropagation(); }} className="w-full h-full absolute">
{ setOpenSidebar(!openSidebar); }}> {openSidebar ? ( ) : ( )}

Lens View

{ setViewType(e.target.checked ? "slider" : "lens"); }} />

Slider View

Zoom Amount ({zoomAmount}%)

{ setZoomAmount(e.target.value); localStorage.setItem("zoomAmount", e.target.value); }} />

Lens Size ({lensSize / 10})

{ setLensSize(parseInt(e.target.value)); }} />
); }; export default ImageOptions;