import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { vscode } from "../utils/vscode" import { HistoryItem } from "../../../src/shared/HistoryItem" type HistoryViewProps = { taskHistory: HistoryItem[] onDone: () => void } const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => { const handleHistorySelect = (id: string) => { vscode.postMessage({ type: "showTaskWithId", text: id }) } const handleDeleteHistoryItem = (id: string) => { vscode.postMessage({ type: "deleteTaskWithId", text: id }) } const handleExportMd = (id: string) => { vscode.postMessage({ type: "exportTaskWithId", text: id }) } const formatDate = (timestamp: number) => { const date = new Date(timestamp) return date .toLocaleString("en-US", { month: "long", day: "numeric", hour: "numeric", minute: "2-digit", hour12: true, }) .replace(", ", " ") .replace(" at", ",") .toUpperCase() } return ( <>