import { PropsWithChildren } from 'react'; import { Menu, MenuButton, MenuList, MenuLink as ReachMenuLink, } from '@reach/menu-button'; import clsx from 'clsx'; import { User, ChevronDown } from 'react-feather'; import { UISrefProps, useSref } from '@uirouter/react'; import { useUser } from '@/portainer/hooks/useUser'; import { AutomationTestingProps } from '@/types'; import { useHeaderContext } from './HeaderContainer'; import styles from './HeaderTitle.module.css'; interface Props { title: string; } export function HeaderTitle({ title, children }: PropsWithChildren) { useHeaderContext(); const { user } = useUser(); return (
{title} {children} {user && {user.Username}} {!window.ddExtension && ( )}
); } interface MenuLinkProps extends AutomationTestingProps, UISrefProps { label: string; } function MenuLink({ to, label, params, options, 'data-cy': dataCy, }: MenuLinkProps) { const anchorProps = useSref(to, params, options); return ( {label} ); }