(children: SidebarItem[], parentIndex: number)
| 354 | // -- Render ---------------------------------------------------------------- |
| 355 | |
| 356 | const renderChildren = (children: SidebarItem[], parentIndex: number) => { |
| 357 | return ( |
| 358 | <div className="flex flex-col gap-y-1 mt-1"> |
| 359 | {children.map((child, j) => { |
| 360 | const classes = getItemClass(child, currentRouteName); |
| 361 | if (child.path) { |
| 362 | return ( |
| 363 | <RouterLink |
| 364 | key={`${parentIndex}-${j}`} |
| 365 | to={{ |
| 366 | name: child.path, |
| 367 | params: { projectId }, |
| 368 | }} |
| 369 | className={`${childRouteClass} cursor-pointer no-underline text-inherit ${classes.join(" ")}`} |
| 370 | onClick={() => recordItemVisit(child.path!)} |
| 371 | > |
| 372 | {child.title} |
| 373 | </RouterLink> |
| 374 | ); |
| 375 | } |
| 376 | return null; |
| 377 | })} |
| 378 | </div> |
| 379 | ); |
| 380 | }; |
| 381 | |
| 382 | const renderItem = (item: SidebarItem, index: number) => { |
| 383 | const key = `${index}`; |
no test coverage detected