import { useCallback } from "react"; import { useAppStore } from "../stores/app-store"; function formatTime(ts: number): string { const d = new Date(ts); return `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`; } interface HistoryListProps { sendJSON: (obj: Record) => void; } export function HistoryList({ sendJSON }: HistoryListProps) { const history = useAppStore((s) => s.history); const clearHistory = useAppStore((s) => s.clearHistory); const showToast = useAppStore((s) => s.showToast); const handleItemClick = useCallback( (text: string) => { sendJSON({ type: "paste", text }); showToast("\u53d1\u9001\u7c98\u8d34\u2026"); }, [sendJSON, showToast], ); return (

{"\u5386\u53f2\u8bb0\u5f55"}

{history.length === 0 ? (

{"\u6682\u65e0\u8bb0\u5f55"}

) : (
{history.map((item, i) => ( ))}
)}
); }