import type { User } from 'firebase/auth';
import {
GripIcon,
LockIcon,
ShieldCheckIcon,
SquareArrowOutUpRightIcon,
XIcon,
} from 'lucide-react';
import { type KeyboardEvent, type ReactNode, useRef } from 'react';
import { useModalOverlay, useOverlayTrigger } from 'react-aria';
import { Button } from 'react-aria-components/Button';
import { MenuTrigger } from 'react-aria-components/Menu';
import {
type OverlayTriggerState,
useOverlayTriggerState,
} from 'react-stately';
import { Avatar } from './Avatar';
import { Menu, MenuItem, MenuSeparator } from './Menu';
const dismiss = (e: KeyboardEvent, action: () => void): void => {
if (e.key !== 'Escape') {
return;
}
action();
};
export type HeaderLink = {
key: string;
action: {
url: string;
};
};
export type HeaderProps = {
children: ReactNode;
links?: HeaderLink[];
currentUser?: User;
logout?: () => void;
};
export const Header = ({ children, links, ...props }: HeaderProps) => {
const state = useOverlayTriggerState(props as OverlayTriggerState);
const { triggerProps, overlayProps } = useOverlayTrigger(
{ type: 'dialog' },
state,
);
const { currentUser, logout } = props;
return (
This is an official website of the State of Utah. Here's how you know:
Official Utah websites use utah.gov in the browser's address bar. A Utah.gov website belongs to an official government organization in the State of Utah.