import { ServerNotification } from "@modelcontextprotocol/sdk/types.js"; import { useState } from "react"; import JsonView from "./JsonView"; const HistoryAndNotifications = ({ requestHistory, serverNotifications, }: { requestHistory: Array<{ request: string; response?: string }>; serverNotifications: ServerNotification[]; }) => { 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 (

History

{requestHistory.length === 0 ? (

No history yet

) : ( )}

Server Notifications

{serverNotifications.length === 0 ? (

No notifications yet

) : ( )}
); }; export default HistoryAndNotifications;