mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
24 lines
691 B
TypeScript
24 lines
691 B
TypeScript
import { ReactNode } from 'react';
|
|
import { Text, List, ListItem, Icon, Row } from '@umami/react-zen';
|
|
|
|
export interface SideMenuProps {
|
|
items: { id: string; label: string; url: string; icon?: ReactNode }[];
|
|
selectedKey?: string;
|
|
}
|
|
|
|
export function SideMenu({ items, selectedKey }: SideMenuProps) {
|
|
return (
|
|
<List>
|
|
{items.map(({ id, label, url, icon }) => {
|
|
return (
|
|
<ListItem key={id} id={id} href={url}>
|
|
<Row alignItems="center" gap>
|
|
{icon && <Icon>{icon}</Icon>}
|
|
<Text weight={id === selectedKey ? 'bold' : 'regular'}>{label}</Text>
|
|
</Row>
|
|
</ListItem>
|
|
);
|
|
})}
|
|
</List>
|
|
);
|
|
}
|