mirror of
https://github.com/vercel/components.build.git
synced 2026-09-14 20:06:39 +08:00
55fae375a4
* Update Geistdocs * Update geistdocs.tsx * Run translation script * Delete toc.tsx * Update route.ts * Update route.ts
14 lines
322 B
TypeScript
14 lines
322 B
TypeScript
import { atom, useAtom } from "jotai";
|
|
|
|
// Export the sidebar open state atom so it can be used from other parts of the app
|
|
export const sidebarOpenAtom = atom<boolean>(false);
|
|
|
|
export const useSidebarContext = () => {
|
|
const [isOpen, setIsOpen] = useAtom(sidebarOpenAtom);
|
|
|
|
return {
|
|
isOpen,
|
|
setIsOpen,
|
|
};
|
|
};
|