-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.tsx
More file actions
49 lines (44 loc) · 1.12 KB
/
index.tsx
File metadata and controls
49 lines (44 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import classNames from 'classnames';
import type { ComponentProps, FC } from 'react';
import SidebarItem from '#ui/Containers/Sidebar/SidebarItem';
import type { FormattedMessage, LinkLike } from '#ui/types';
import styles from './index.module.css';
type SidebarGroupProps = {
groupName: FormattedMessage;
items: Array<Omit<ComponentProps<typeof SidebarItem>, 'as' | 'pathname'>>;
as?: LinkLike;
pathname?: string;
className: string;
showProgressionIcons?: boolean;
};
const SidebarGroup: FC<SidebarGroupProps> = ({
groupName,
items,
showProgressionIcons,
className,
...props
}) => (
<section
className={classNames(
{
[styles.group]: true,
[styles.progression]: showProgressionIcons,
},
className
)}
>
<label className={styles.groupName}>{groupName}</label>
<ul className={styles.itemList}>
{items.map(({ label, link }) => (
<SidebarItem
key={link}
label={label}
link={link}
showProgressionIcons={showProgressionIcons}
{...props}
/>
))}
</ul>
</section>
);
export default SidebarGroup;