umami/components/layout/SideNav.js

18 lines
522 B
JavaScript
Raw Normal View History

2023-03-23 19:46:49 +01:00
import { Menu, Item } from 'react-basics';
import Link from 'next/link';
import styles from './SideNav.module.css';
2023-03-24 00:33:10 +01:00
export default function SideNav({ selectedKey, items, shallow, onSelect = () => {} }) {
2023-03-23 19:46:49 +01:00
return (
2023-03-24 00:33:10 +01:00
<Menu items={items} selectedKey={selectedKey} className={styles.menu} onSelect={onSelect}>
2023-03-23 19:46:49 +01:00
{({ key, label, url }) => (
<Item key={key} className={styles.item}>
<Link href={url} shallow={shallow}>
{label}
</Link>
</Item>
)}
</Menu>
);
}