Display-only React hook that ticks a `HH:MM:SS` clock once per second while time tracking is active, and shows a static elapsed time otherwise. ## Key Components - **`useTrackerClock`** — Main hook. Returns a formatted `HH:MM:SS` string derived from `accumulatedMs` plus live elapsed time since `runningSince`. The interval runs only when `status === 'tracking'`; it clears automatically on pause/stop or unmount. - **`formatElapsed`** — Internal utility. Converts a total millisecond value to a zero-padded `HH:MM:SS` string, clamping negative values to `0`. - **`UseTrackerClockArgs`** — Input interface describing the tracker state needed to drive the clock. ## Usage Example ```typescript import { useTrackerClock } from './use-tracker-clock' function TimerDisplay({ entry }) { const elapsed = useTrackerClock({ status: entry.status, // 'tracking' | 'paused' | 'stopped' runningSince: entry.startedAt, // epoch ms when current segment began accumulatedMs: entry.totalMs, // ms logged before current segment }) return {elapsed} // e.g. "01:23:45" } ``` ## Notes - `runningSince` is only meaningful when `status === 'tracking'`; passing it in other states has no effect. - The interval resets whenever `status` or `runningSince` changes, preventing drift when a session is paused and resumed. - `accumulatedMs` defaults to `0`, so the hook works for brand-new sessions with no prior logged time. **Source:** [`use-tracker-clock.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/use-tracker-clock.ts)