import { html, view } from '@lib/html'; /* * In this Navbar component, we want to add the "active" class to the * current link. * Because this component is used by the _layout.ts file, we can't use * the request object to get the current path (which will be a _layout path). * Instead, we'll use the location object, which is available in the browser. * To do this, we'll use the _hyperscript "on load" event to * check the current path and add the "active" class if the path matches. */ export default () => { const links = [ { text: 'Home', href: '/dashboard' }, { text: 'Page', href: '/dashboard/4' }, ]; return html` `; };