11import { useEffect , useMemo , useRef , useState } from "react" ;
22import { PanelLeftOpen , Plus , Search } from "lucide-react" ;
3+ import {
4+ SidebarAlertTriangleIcon ,
5+ SidebarBoxIcon ,
6+ SidebarGrid07Icon ,
7+ SidebarLaptopIcon ,
8+ SidebarListUnordered4Icon ,
9+ SidebarMessageIcon ,
10+ SidebarPuzzlePiece02Icon ,
11+ SidebarRobotIcon ,
12+ SidebarTimer2Icon ,
13+ SidebarUserIcon ,
14+ SidebarUsersIcon ,
15+ } from "@/components/ui/Icons" ;
316import { SidebarRailControlButton } from "./SidebarRailControlButton" ;
417import { SidebarUserButton } from "./SidebarUserButton" ;
518import { LogoMark , LogoWordmark } from "./WorkspaceSidebarBrand" ;
@@ -11,24 +24,22 @@ import { classNames } from "@/shared/lib/classNames";
1124import styles from "./WorkspaceSidebar.module.css" ;
1225import type { PrimaryNavigationItem , PrimaryNavigationSection } from "./WorkspacePrimaryNavigation" ;
1326import type { WorkspaceContextSectionId , WorkspaceSidebarProps } from "./types" ;
14- import type { CSSProperties } from "react" ;
27+ import type { ComponentType } from "react" ;
1528
16- type NavigationIconStyle = CSSProperties & {
17- "--workspace-nav-icon-url" : string ;
18- } ;
29+ type SidebarNavigationIcon = ComponentType < { size ?: number | string } > ;
1930
2031const WORKSPACE_NAVIGATION_ICONS = {
21- agents : "icons/workspace-agents.svg" ,
22- computers : "icons/workspace-computers.svg" ,
23- humans : "icons/workspace-humans.svg" ,
24- messages : "icons/workspace-messages.svg" ,
25- models : "icons/workspace-models.svg" ,
26- notifications : "icons/workspace-notifications.svg" ,
27- scheduledTasks : "icons/workspace-scheduled-tasks.svg" ,
28- skills : "icons/workspace-skills.svg" ,
29- tasks : "icons/workspace-tasks.svg" ,
30- teams : "icons/workspace-teams.svg" ,
31- templates : "icons/workspace-templates.svg" ,
32+ agents : SidebarRobotIcon ,
33+ computers : SidebarLaptopIcon ,
34+ humans : SidebarUserIcon ,
35+ messages : SidebarMessageIcon ,
36+ models : SidebarBoxIcon ,
37+ notifications : SidebarAlertTriangleIcon ,
38+ scheduledTasks : SidebarTimer2Icon ,
39+ skills : SidebarPuzzlePiece02Icon ,
40+ tasks : SidebarListUnordered4Icon ,
41+ teams : SidebarUsersIcon ,
42+ templates : SidebarGrid07Icon ,
3243} as const ;
3344
3445export function WorkspaceSidebar ( {
@@ -535,14 +546,8 @@ export function WorkspaceSidebar({
535546 ) ;
536547}
537548
538- function navigationIcon ( path : string ) {
539- return (
540- < span
541- className = { styles . primaryNavIconMask }
542- style = { { "--workspace-nav-icon-url" : `url("${ path } ")` } as NavigationIconStyle }
543- aria-hidden = "true"
544- />
545- ) ;
549+ function navigationIcon ( Icon : SidebarNavigationIcon ) {
550+ return < Icon size = { 20 } /> ;
546551}
547552
548553function badgeCount ( count : number | null | undefined ) {
0 commit comments