import { ServerNotification } from "@modelcontextprotocol/sdk/types.js"; import { useState } from "react"; import JsonView from "./JsonView"; import { Button } from "@/components/ui/button"; const HistoryAndNotifications = ({ requestHistory, serverNotifications, onClearHistory, onClearNotifications, }: { requestHistory: Array<{ request: string; response?: string }>; serverNotifications: ServerNotification[]; onClearHistory?: () => void; onClearNotifications?: () => void; }) => { const [expandedRequests, setExpandedRequests] = useState<{ [key: number]: boolean; }>({}); const [expandedNotifications, setExpandedNotifications] = useState<{ [key: number]: boolean; }>({}); const toggleRequestExpansion = (index: number) => { setExpandedRequests((prev) => ({ ...prev, [index]: !prev[index] })); }; const toggleNotificationExpansion = (index: number) => { setExpandedNotifications((prev) => ({ ...prev, [index]: !prev[index] })); }; return (
No history yet
) : (No notifications yet
) : (