feat: add userMenuItems prop to TopBar and export DropdownItem type
All checks were successful
Build & Publish / publish (push) Successful in 1m0s
All checks were successful
Build & Publish / publish (push) Successful in 1m0s
Allows consumers to inject custom menu items above the Logout action in the user dropdown. Items are separated from Logout by a divider. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ export type { Column, DataTableProps } from './DataTable/types'
|
||||
export { DetailPanel } from './DetailPanel/DetailPanel'
|
||||
export { EntityList } from './EntityList/EntityList'
|
||||
export { Dropdown } from './Dropdown/Dropdown'
|
||||
export type { DropdownItem } from './Dropdown/Dropdown'
|
||||
export { EventFeed } from './EventFeed/EventFeed'
|
||||
export { GroupCard } from './GroupCard/GroupCard'
|
||||
export { KpiStrip } from './KpiStrip/KpiStrip'
|
||||
|
||||
@@ -17,6 +17,7 @@ interface TopBarProps {
|
||||
breadcrumb: BreadcrumbItem[]
|
||||
environment?: ReactNode
|
||||
user?: { name: string }
|
||||
userMenuItems?: import('../../composites/Dropdown/Dropdown').DropdownItem[]
|
||||
onLogout?: () => void
|
||||
className?: string
|
||||
}
|
||||
@@ -32,6 +33,7 @@ export function TopBar({
|
||||
breadcrumb,
|
||||
environment,
|
||||
user,
|
||||
userMenuItems,
|
||||
onLogout,
|
||||
className,
|
||||
}: TopBarProps) {
|
||||
@@ -114,6 +116,8 @@ export function TopBar({
|
||||
</div>
|
||||
}
|
||||
items={[
|
||||
...(userMenuItems ?? []),
|
||||
...(userMenuItems?.length ? [{ label: '', divider: true }] : []),
|
||||
{ label: 'Logout', icon: <Power size={14} />, onClick: onLogout },
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user