import type { ReactNode } from "react"; /** Props for the top navbar — user menu, nav items, and the toggle/peek affordances shared with SideBar. */ export type NavbarProps = { /** Prop name is spelled exactly this way ("Avathar") — not a typo to correct at the call site. */ userAvathar?: string; /** Name shown in the account menu header; also the avatar's initials source when no image is given. */ userName: string; /** Secondary line under the name in the account menu. */ userRole?: string; /** Entries listed in the account menu, in order, above the logout item. */ navMenu: MenuProps[]; /** Right-cluster slot before the avatar (org switcher, bell, launcher trigger). Its child may shrink; give icon buttons `flexShrink={0}`. */ moreIcon?: ReactNode; /** Called with a menu entry's `url` when it is chosen; the bar does not navigate itself. */ handleNavOnClick: (url: string) => void; /** Called when the logout item is chosen. */ handleLogout: () => void; /** Label of the logout item. */ logoutText: string; /** Page title shown on the left, with an optional back button. */ navigationBarText?: { /** Title content; truncated to one line, with a tooltip when the text is a string. */ text: ReactNode; /** Shows a "Go back" button before the title and calls this when pressed. */ onIconClick?: () => void; }; /** Whether the sidebar is currently open; flips the hamburger icon and its accessible name. */ sideBarToggole?: boolean; /** Called when the hamburger is pressed. */ onSideBarToggole?: () => void; /** * Force the sidebar hamburger to show at all widths (not just below `lg`). * Set this when the sidebar is in "mobile navbar" mode on a big screen, so the * hamburger remains available to open the overlay. Defaults to `false` * (hamburger shows only below `lg`). */ forceSideBarToggle?: boolean; /** * Hovering the sidebar toggle peeks the sidebar open without pinning it. Wire this to the * same state the SideBar's `peekOpen` reads; it closes itself when the pointer leaves. */ onSideBarPeek?: () => void; /** Rendered between the sidebar toggle/back button and the title, outside the title element, followed by a 1px divider. */ leading?: ReactNode; }; /** One navMenu entry (id/title/url/icon) — unrelated to Chakra's own MenuProps despite the shared name. */ export type MenuProps = { /** Optional key for the entry; falls back to `url`, then `title`. */ id?: string | number; /** Entry text, truncated to one line with a native title tooltip. */ title: string; /** Passed to `handleNavOnClick` when the entry is chosen. */ url: string; /** Leading icon, shown at 16px. */ icon?: ReactNode; };