From 428e1444be330f06ab6bd299b8683960de7b6003 Mon Sep 17 00:00:00 2001 From: ashutosh16 Date: Tue, 20 Aug 2024 22:12:31 -0700 Subject: [PATCH] add toolbar ext add toolbar ext add toolbar ext --- src/components/top-bar/top-bar.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/top-bar/top-bar.tsx b/src/components/top-bar/top-bar.tsx index 6f9def32..b677b21f 100644 --- a/src/components/top-bar/top-bar.tsx +++ b/src/components/top-bar/top-bar.tsx @@ -30,6 +30,7 @@ export interface Toolbar { breadcrumbs?: { title: string | React.ReactNode, path?: string; }[]; tools?: React.ReactNode; actionMenu?: ActionMenu; + toolBarExtensions?: React.ReactNode[]; } export interface TopBarProps extends React.Props { @@ -85,7 +86,7 @@ const renderBreadcrumbs = (breadcrumbs: { title: string | React.ReactNode, path? ); -const renderActionMenu = (actionMenu: ActionMenu) => ( +const renderActionMenu = (actionMenu: ActionMenu, toolBarExts: React.ReactNode[]) => (
{actionMenu.items.map((item, i) => ( ))} + {toolBarExts && toolBarExts.map((ext, index) => ( + {ext} + ))}
); const renderToolbar = (toolbar: Toolbar) => (
- {toolbar.actionMenu && renderActionMenu(toolbar.actionMenu)} + {toolbar.actionMenu && renderActionMenu(toolbar.actionMenu, toolbar.toolBarExtensions)}
+
{toolbar.filter && renderFilter(toolbar.filter)} {toolbar.tools}