mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 21:27:20 +01:00
Updated tables. Added MenuButton.
This commit is contained in:
parent
92b283486e
commit
a15c7cd596
27 changed files with 334 additions and 207 deletions
|
|
@ -1,17 +1,21 @@
|
|||
import { Text, List, ListItem } from '@umami/react-zen';
|
||||
import { ReactNode } from 'react';
|
||||
import { Text, List, ListItem, Icon, Row } from '@umami/react-zen';
|
||||
|
||||
export interface SideMenuProps {
|
||||
items: { id: string; label: string; url: string }[];
|
||||
items: { id: string; label: string; url: string; icon?: ReactNode }[];
|
||||
selectedKey?: string;
|
||||
}
|
||||
|
||||
export function SideMenu({ items, selectedKey }: SideMenuProps) {
|
||||
return (
|
||||
<List>
|
||||
{items.map(({ id, label, url }) => {
|
||||
{items.map(({ id, label, url, icon }) => {
|
||||
return (
|
||||
<ListItem key={id} id={id} href={url}>
|
||||
<Text weight={id === selectedKey ? 'bold' : 'regular'}>{label}</Text>
|
||||
<Row alignItems="center" gap>
|
||||
{icon && <Icon>{icon}</Icon>}
|
||||
<Text weight={id === selectedKey ? 'bold' : 'regular'}>{label}</Text>
|
||||
</Row>
|
||||
</ListItem>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue