import { SidebarGroup, SidebarItem } from 'shared/types' import styles from './index.module.scss' import { Link } from '../Link/index' interface SidebarProps { sidebarData: SidebarGroup[] pathname: string } export function Sidebar(props: SidebarProps) { const { sidebarData, pathname } = props const renderGroupItem = (item: SidebarItem) => { const active = item.link === pathname return (
{item.text}
) } const renderGroup = (item: SidebarGroup) => { return (

{item.text}

{item.items?.map((item) => (
{renderGroupItem(item)}
))}
) } return ( ) }