diff --git a/web/src/components/ui/sidebar/Sidebar.tsx b/web/src/components/ui/sidebar/Sidebar.tsx index ad7e9f415..6bbb8b028 100644 --- a/web/src/components/ui/sidebar/Sidebar.tsx +++ b/web/src/components/ui/sidebar/Sidebar.tsx @@ -4,14 +4,19 @@ import { SidebarCollapsible } from './SidebarCollapsible'; import { SidebarItem } from './SidebarItem'; export const Sidebar: React.FC = React.memo( - ({ header, content, footer, activeItem }) => { + ({ header, content, footer, activeItem, isSortable = false }) => { return (
{header}
{content.map((item, index) => ( - + ))}
@@ -26,9 +31,10 @@ Sidebar.displayName = 'Sidebar'; const ContentSelector: React.FC<{ content: SidebarProps['content'][number]; activeItem: SidebarProps['activeItem']; -}> = React.memo(({ content, activeItem }) => { + isSortable: SidebarProps['isSortable']; +}> = React.memo(({ content, activeItem, isSortable }) => { if (isSidebarGroup(content)) { - return ; + return ; } return ; diff --git a/web/src/components/ui/sidebar/SidebarCollapsible.tsx b/web/src/components/ui/sidebar/SidebarCollapsible.tsx index f6d3ae9c9..db3b91c03 100644 --- a/web/src/components/ui/sidebar/SidebarCollapsible.tsx +++ b/web/src/components/ui/sidebar/SidebarCollapsible.tsx @@ -40,7 +40,15 @@ const SidebarTrigger: React.FC = React.memo(({ label, isOpe SidebarTrigger.displayName = 'SidebarTrigger'; export const SidebarCollapsible: React.FC = React.memo( - ({ label, items, activeItem, variant = 'collapsible', icon, defaultOpen = true }) => { + ({ + label, + items, + isSortable = false, + activeItem, + variant = 'collapsible', + icon, + defaultOpen = true + }) => { const [isOpen, setIsOpen] = React.useState(defaultOpen); return ( diff --git a/web/src/components/ui/sidebar/interfaces.ts b/web/src/components/ui/sidebar/interfaces.ts index d15e6f3f7..1935e81b3 100644 --- a/web/src/components/ui/sidebar/interfaces.ts +++ b/web/src/components/ui/sidebar/interfaces.ts @@ -17,6 +17,7 @@ export interface ISidebarGroup { items: ISidebarItem[]; variant?: 'collapsible' | 'icon'; //default is collapsible defaultOpen?: boolean; //will default to true + isSortable?: boolean; } export interface ISidebarList { @@ -30,4 +31,5 @@ export interface SidebarProps { content: SidebarContent[]; footer?: React.ReactNode; activeItem: string; + isSortable?: boolean; }