1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00
portainer/app/react/sidebar/SidebarSection.tsx

27 lines
488 B
TypeScript
Raw Normal View History

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>
</>
);
}