import { AppBar, AppBarProps, Grid, Tabs, TabsProps, Toolbar, ToolbarProps } from '@mui/material'; import { Fragment, memo, SyntheticEvent } from 'react'; import { ActionBar, ActionBarProps } from './ActionBar/ActionBar'; import { LinkTab, LinkTabProps } from './LinkTab/LinkTab'; import css from './NavBar.module.scss'; export interface NavBarProps { /** The tabs to render */ tabs: LinkTabProps[]; /** The title to show in the ActionBar */ actionBarTitle: string; /** * The currently active tab * Preferably managed in local state */ activeTab: number; /** Function to trigger when changing tabs */ onTabChange(_event: SyntheticEvent, newValue: number): void; /** Additional props to pass to the AppBar component */ AppBarProps?: AppBarProps; /** Additional props to pass to the Toolbar component */ ToolbarProps?: ToolbarProps; /** Additional props to pass to the Tabs component */ TabsProps?: TabsProps; /** Additional props to pass to the ActionBar component */ ActionBarProps?: ActionBarProps; } export const NavBar = memo( ({ ActionBarProps, AppBarProps, TabsProps, ToolbarProps, actionBarTitle, activeTab, onTabChange, tabs }: NavBarProps) => ( {tabs.map((tab, index) => ( ))} ) );