MCPcopy Create free account
hub / github.com/bytebase/bytebase / renderChildren

Function renderChildren

frontend/src/react/components/ProjectSidebar.tsx:356–380  ·  view source on GitHub ↗
(children: SidebarItem[], parentIndex: number)

Source from the content-addressed store, hash-verified

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}`;

Callers 1

renderItemFunction · 0.70

Calls 1

getItemClassFunction · 0.70

Tested by

no test coverage detected