import { History } from "./history_types"; import toast from "react-hot-toast"; import classNames from "classnames"; import { Badge } from "../ui/badge"; import { renderHistory } from "./utils"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../ui/collapsible"; import { Button } from "../ui/button"; import { CaretSortIcon } from "@radix-ui/react-icons"; interface Props { history: History; currentVersion: number | null; revertToVersion: (version: number) => void; shouldDisableReverts: boolean; } export default function HistoryDisplay({ history, currentVersion, revertToVersion, shouldDisableReverts, }: Props) { const renderedHistory = renderHistory(history, currentVersion); return renderedHistory.length === 0 ? null : (