import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { useExtensionState } from "../context/ExtensionStateContext" import { vscode } from "../utils/vscode" import { memo } from "react" type HistoryPreviewProps = { showHistoryView: () => void } const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => { const { taskHistory } = useExtensionState() 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 (