import { useState } from 'react'; import './CognitiveTrace.css'; const PHASE_ICONS = { perception: '๐Ÿ‘€', recall: '๐Ÿ“š', association: '๐Ÿ”—', synthesis: '๐Ÿงช', reasoning: '๐Ÿง ', error: 'โš ๏ธ' }; function CognitiveTrace({ traces }) { const [expandedIndex, setExpandedIndex] = useState(null); if (!traces || traces.length === 0) { return (
Waiting for neural activity...
); } return (
Cognitive Trace Log
{traces.map((trace, idx) => (
setExpandedIndex(expandedIndex === idx ? null : idx)} >
{PHASE_ICONS[trace.phase] || '๐Ÿ“'} {trace.message} {trace.data && [{expandedIndex === idx ? '-' : '+'}]}
{trace.data && expandedIndex === idx && (
{JSON.stringify(trace.data, null, 2)}
)}
))}
); } export default CognitiveTrace;