);
}
export function Sidebar({ children }) {
const open = appShellStore((store) => store.sidebarOpen);
const close = appShellStore((store) => store.closeSidebar);
const ref = useClickOutside(close, ["mouseup", "touchend"]); //, [document.getElementById("header")]);
const [location] = useLocation();
const closeHandler = () => {
open && close();
};
// listen for window location change
useEffect(closeHandler, [location]);
// @todo: potentially has to be added to the root, as modals could be opened
useHotkeys([["Escape", closeHandler]]);
return (
<>