mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
27 lines
488 B
TypeScript
27 lines
488 B
TypeScript
|
import { PropsWithChildren, ReactNode } from 'react';
|
||
|
|
||
|
import styles from './SidebarSection.module.css';
|
||
|
|
||
|
interface Props {
|
||
|
title: ReactNode;
|
||
|
label?: string;
|
||
|
}
|
||
|
|
||
|
export function SidebarSection({
|
||
|
title,
|
||
|
label,
|
||
|
children,
|
||
|
}: PropsWithChildren<Props>) {
|
||
|
const labelText = typeof title === 'string' ? title : label;
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<li className={styles.sidebarTitle}>{title}</li>
|
||
|
|
||
|
<nav aria-label={labelText}>
|
||
|
<ul>{children}</ul>
|
||
|
</nav>
|
||
|
</>
|
||
|
);
|
||
|
}
|