"use client"; import React from "react"; function NodeBadge({ children, tone = "gray" }) { const tones = { gray: "border-gray-200 bg-gray-50 text-gray-700", blue: "border-blue-200 bg-blue-50 text-blue-700", green: "border-green-200 bg-green-50 text-green-700", yellow: "border-yellow-200 bg-yellow-50 text-yellow-700", }; return ( {children} ); } function NodeGroup({ title, nodes }) { if (!nodes?.length) return null; return (

{title} ({nodes.length})

); } export default function SituationGraphView({ situationGraph, selectedQuestion, }) { if (!situationGraph) return null; const selectedQuestionText = typeof selectedQuestion === "string" ? selectedQuestion : selectedQuestion?.question ?? null; const activeUnknown = situationGraph.activeUnknownNodeId ? situationGraph.nodes.find((node) => node.id === situationGraph.activeUnknownNodeId) : null; const nodesByKind = situationGraph.nodes.reduce((acc, node) => { if (!acc[node.kind]) acc[node.kind] = []; acc[node.kind].push(node); return acc; }, {}); return (
{selectedQuestionText && (

Selected Question

{selectedQuestionText}

)}

Situation Graph

Central statement
{situationGraph.centralStatement}
{situationGraph.currentSummary && (
Current summary
{situationGraph.currentSummary}
)} {activeUnknown && (
Active unknown
{activeUnknown.label}
)}
Edge count
{situationGraph.edges.length}
{Object.entries(nodesByKind).map(([kind, nodes]) => ( ))}
Raw graph JSON
          {JSON.stringify(situationGraph, null, 2)}
        
); }