/** * Loads the history timeline from `GET /api/history`, through * useRecord (its `items`), so it shares the cache, the reload that * invalidates first, and the error handling with every detail page. * * The API also sends `undated`, the number of published entries it * left out for having no date. Nothing shows it; read it here if the * admin ever wants a warning. */ import type { TimelineItem } from './timeline.ts' import { useRecord } from './useRecord.ts' export function useHistory() { const { data, loading, error, reload } = useRecord('/history', 'items') return { items: data ?? [], loading, error, reload } }