import { atom } from 'nanostores'; export const $activeLeftDrawer = atom(null); export function openLeftDrawer(drawerId) { $activeLeftDrawer.set(drawerId || null); } export function closeLeftDrawer(drawerId = null) { if (!drawerId) { $activeLeftDrawer.set(null); return; } if (String($activeLeftDrawer.get() || '') === String(drawerId)) { $activeLeftDrawer.set(null); } }