MCPcopy
hub / github.com/ValueCell-ai/ClawX / NavItem

Function NavItem

src/components/layout/Sidebar.tsx:58–92  ·  view source on GitHub ↗
({ to, icon, label, badge, collapsed, onClick, testId }: NavItemProps)

Source from the content-addressed store, hash-verified

56}
57
58function NavItem({ to, icon, label, badge, collapsed, onClick, testId }: NavItemProps) {
59 return (
60 <NavLink
61 to={to}
62 onClick={onClick}
63 data-testid={testId}
64 className={({ isActive }) =>
65 cn(
66 'sidebar-nav-text flex items-center gap-2 rounded-lg px-2.5 py-1.5 transition-colors',
67 'hover:bg-black/5 dark:hover:bg-white/5 text-foreground/80',
68 isActive
69 ? 'bg-black/5 dark:bg-white/10 text-foreground'
70 : '',
71 collapsed && 'justify-center px-0'
72 )
73 }
74 >
75 <>
76 <div className="flex shrink-0 items-center justify-center text-current [&_svg]:size-4">
77 {icon}
78 </div>
79 {!collapsed && (
80 <>
81 <span className="flex-1 overflow-hidden text-ellipsis whitespace-nowrap">{label}</span>
82 {badge && (
83 <Badge variant="secondary" className="ml-auto shrink-0">
84 {badge}
85 </Badge>
86 )}
87 </>
88 )}
89 </>
90 </NavLink>
91 );
92}
93
94const INITIAL_NOW_MS = Date.now();
95const DEFAULT_EXPANDED_SESSION_BUCKETS: Record<SessionBucketKey, boolean> = {

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected