import wiredMonitorImage from '../../assets/images/wiredtools/wired_monitor.png'; import { Button, Text } from '../../common'; import { MonitorLog, MonitorLogDetails, MonitorStat } from './WiredCreatorTools.types'; export interface WiredMonitorTabViewProps { monitorStats: MonitorStat[]; monitorLogs: MonitorLog[]; /** * Used only as a disabled-state predicate for the "Clear all" button: * if both this is empty and every log has amount '0', there is nothing * to clear. The view does not render the history itself. */ monitorHistoryRows: { id: string; }[]; onOpenMonitorInfo: () => void; onOpenMonitorHistory: () => void; onClearMonitorLogs: () => void; onOpenMonitorLogDetails: (type: string, details: Pick) => void; } /** * The "Monitor" tab body of WiredCreatorToolsView, extracted from the * parent's inline JSX. The three modal overlays that used to live * inside this block were dead code (`{ false && ... }`) and have been * dropped; the live versions of those modals (Monitor History, Monitor * Info, Error Info) are mounted outside the NitroCardView by the parent. */ export const WiredMonitorTabView = (props: WiredMonitorTabViewProps) => { const { monitorStats, monitorLogs, monitorHistoryRows, onOpenMonitorInfo, onOpenMonitorHistory, onClearMonitorLogs, onOpenMonitorLogDetails } = props; return (
Statistics:
{ monitorStats.map(stat => (
{ stat.label }: { stat.value }
)) }
Monitor preview
Logs:
{ monitorLogs.map((log, index) => ( onOpenMonitorLogDetails(log.type, { severity: log.category, amount: log.amount, latest: log.latest, reason: log.latestReason, sourceLabel: log.latestSourceLabel, sourceId: log.latestSourceId }) }> )) }
Type Severity Amount Latest occurrence
{ log.type } { log.category } { log.amount } { log.latest }
); };