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 (
skip to main content
{children}
{links && (
{(link) => ( {link.key} {link.action.url.toLowerCase().startsWith('https') ? ( <> ) : null} )}
)} {currentUser && ( Utahid account Gravatar account Sign out )}
{state.isOpen && }
); }; const Flyout = ({ state, ...props }: { state: OverlayTriggerState }) => { const ref = useRef(null); const { modalProps } = useModalOverlay( { ...props, isKeyboardDismissDisabled: false, isDismissable: true }, state, ref, ); 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.

Be careful when sharing sensitive information. Share sensitive information only on secure official Utah.gov websites.
© State of Utah
); }; export const UgrcLogo = () => ( ); const UtahLogo = ({ className }: { className: string }) => ( );