/** @jsxImportSource preact */ import type { FunctionalComponent } from 'preact'; import { useState, useEffect } from 'preact/hooks'; const MenuToggle: FunctionalComponent = () => { const [sidebarShown, setSidebarShown] = useState(false); useEffect(() => { const body = document.querySelector('body')!; if (sidebarShown) { body.classList.add('mobile-sidebar-toggle'); } else { body.classList.remove('mobile-sidebar-toggle'); } }, [sidebarShown]); return ( ); }; export default MenuToggle;