Spaces:
Paused
Paused
File size: 1,547 Bytes
5eb4857 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | import React from 'react';
import { motion } from 'framer-motion';
import styles from './TraceGraph.module.css';
interface Node {
id: string;
label: string;
status: 'complete' | 'active' | 'pending';
}
export const TraceGraph: React.FC = () => {
// Demo data for the "analytical journey"
const nodes: Node[] = [
{ id: '1', label: 'Intent Extraction', status: 'complete' },
{ id: '2', label: 'Knowledge Lookup', status: 'complete' },
{ id: '3', label: 'Policy Check', status: 'active' },
{ id: '4', label: 'Response Synthesis', status: 'pending' },
];
return (
<div className={styles.container}>
<div className={styles.header}>Analytical Trace</div>
<div className={styles.graph}>
{nodes.map((node, i) => (
<React.Fragment key={node.id}>
<motion.div
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ delay: i * 0.2 }}
className={`${styles.node} ${styles[node.status]}`}
>
<div className={styles.statusDot} />
<span className={styles.label}>{node.label}</span>
</motion.div>
{i < nodes.length - 1 && (
<motion.div
initial={{ height: 0 }}
animate={{ height: 20 }}
transition={{ delay: i * 0.2 + 0.1 }}
className={styles.connector}
/>
)}
</React.Fragment>
))}
</div>
</div>
);
};
|