-
-
-
+ {(search || (actions && actions.length > 0)) && (
+
+ {search && (
+
+
+
+ )}
+ {actions?.map((action) => (
+
+ ))}
)}
@@ -344,6 +355,49 @@ function SidebarLink({ item, collapsed }: { item: SidebarNavItem; collapsed: boo
)
}
+function SidebarActionLink({ action, collapsed }: { action: SidebarAction; collapsed: boolean }) {
+ const Icon = action.icon
+ const { pathname } = useShell()
+ const active = action.match ? action.match(pathname) : isUnder(pathname, action.to)
+ const count = action.badge ?? 0
+ const label = count > 0 ? `${action.label}: ${count}` : action.label
+
+ return (
+
+
+
+
+ {count > 0 && (
+
+ )}
+
+
+ {label}
+
+ )
+}
+
function UserMenu({ user, collapsed, menu }: { user: SidebarUser; collapsed: boolean; menu?: React.ReactNode }) {
const trigger = (