import { SidebarGroup, SidebarItem } from '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; // console.log(pathname); return (
{item.text}
); }; const renderGroup = (item: SidebarGroup) => { return (

{item.text}

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