import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { vscode } from "../utils/vscode" import { HistoryItem } from "../../../src/shared/HistoryItem" type HistoryPreviewProps = { taskHistory: HistoryItem[] showHistoryView: () => void } const HistoryPreview = ({ taskHistory, showHistoryView }: HistoryPreviewProps) => { const handleHistorySelect = (id: string) => { vscode.postMessage({ type: "showTaskWithId", 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 (