import { useState } from "react"; import { Copy } from "lucide-react"; const CommandHistory = ({ commandHistory, }: { commandHistory: Array<{ command: string; response: string | null }>; }) => { const [expandedCommands, setExpandedCommands] = useState<{ [key: number]: boolean; }>({}); const toggleCommandExpansion = (index: number) => { setExpandedCommands((prev) => ({ ...prev, [index]: !prev[index] })); }; const copyToClipboard = (text: string) => { navigator.clipboard.writeText(text); }; return (
{JSON.stringify(JSON.parse(cmd.command), null, 2)}
{JSON.stringify(JSON.parse(cmd.response), null, 2)}