import { useEffect, useState } from "react"; import { listHistory, type HistoryRecord } from "@/lib/idb"; type Props = { refreshKey?: number; onRegenerate: (h: HistoryRecord) => void; onReuseSeed?: (seed: number) => void; }; function fmtTime(ts: number): string { return new Date(ts).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); } export default function HistoryList({ refreshKey, onRegenerate, onReuseSeed }: Props) { const [items, setItems] = useState([]); useEffect(() => { listHistory().then(setItems); }, [refreshKey]); if (items.length === 0) { return (

Generations will be archived here.

); } return ( ); }