import type { ReactElement } from 'react' import type { HudSnapshot } from '../core/snapshot' import { fmtTime } from './format' const PHIALS: readonly number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] const UPGRADE_LABELS: Record = { damage: 'sharper bolts', fireRate: 'faster casting', speed: 'fleeter feet', vitality: 'thicker blood', regen: 'knitting flesh', multishot: 'split volley', } interface Props { snap: HudSnapshot onRestart: () => void } export const Hud = ({ snap, onRestart }: Props): ReactElement => { const filled = Math.floor((snap.energy / snap.energyCap) * PHIALS.length) const hpPct = (snap.survivorHp / snap.survivorMaxHp) * 100 return ( ) }