cjo93 commited on
Commit
545efe6
·
verified ·
1 Parent(s): d018935

Create src/components/defrag/constellation-graph.tsx

Browse files
src/components/defrag/constellation-graph.tsx ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { motion } from "framer-motion";
5
+ import { Lock, User, GitCommit, ArrowUpRight } from "lucide-react";
6
+ import { Card } from "@/components/ui/card";
7
+ import { Button } from "@/components/ui/button";
8
+ import Link from "next/link";
9
+ import { cn } from "@/lib/utils";
10
+
11
+ // Demo Data (Archetypes)
12
+ const NODES = [
13
+ {
14
+ id: "collab",
15
+ name: "The Collaborator",
16
+ role: "Creative Mirror",
17
+ metric: "Synergy",
18
+ value: 78,
19
+ status: "active",
20
+ desc: "Reflects the tension between shared purpose and sovereignty.",
21
+ },
22
+ {
23
+ id: "father",
24
+ name: "The Patriarch",
25
+ role: "Authority Figure",
26
+ metric: "Structure",
27
+ value: 45,
28
+ status: "locked",
29
+ desc: "Origin point of structural conditioning. Analysis required.",
30
+ },
31
+ {
32
+ id: "shadow",
33
+ name: "The Shadow",
34
+ role: "Repressed Self",
35
+ metric: "Integration",
36
+ value: 12,
37
+ status: "locked",
38
+ desc: "Hidden friction vectors. High potential energy if integrated.",
39
+ },
40
+ ];
41
+
42
+ export function ConstellationGraph() {
43
+ const [selected, setSelected] = useState<string | null>(null);
44
+
45
+ return (
46
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
47
+ {/* ROOT NODE (SELF) */}
48
+ <Card className="p-6 border-amber-500/50 bg-amber-500/5 relative overflow-hidden">
49
+ <div className="absolute top-0 right-0 p-20 bg-amber-500/10 blur-[80px] rounded-full" />
50
+ <div className="relative z-10">
51
+ <div className="text-[10px] font-mono uppercase text-amber-500 mb-2">Root Node</div>
52
+ <h3 className="text-2xl font-bold text-white">Subject</h3>
53
+ <div className="mt-8 flex items-center gap-2 text-xs text-white/50">
54
+ <User className="w-3 h-3" /> Status: <span className="text-white">Conscious</span>
55
+ </div>
56
+ </div>
57
+ </Card>
58
+
59
+ {/* NODES */}
60
+ {NODES.map((node) => {
61
+ const isLocked = node.status === "locked";
62
+ return (
63
+ <motion.div key={node.id} whileHover={!isLocked ? { scale: 1.02 } : {}}>
64
+ <Card
65
+ onClick={() => !isLocked && setSelected(node.id)}
66
+ className={cn(
67
+ "p-6 h-full relative cursor-pointer border-white/5 bg-white/5 hover:bg-white/10 transition-all",
68
+ isLocked && "opacity-60 cursor-not-allowed border-dashed"
69
+ )}
70
+ >
71
+ {isLocked && (
72
+ <div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-black/60 backdrop-blur-sm">
73
+ <Lock className="w-6 h-6 text-white/30 mb-2" />
74
+ <span className="text-[10px] uppercase font-mono tracking-widest text-white/50">
75
+ Architect Access
76
+ </span>
77
+ </div>
78
+ )}
79
+
80
+ <div className="flex justify-between items-start mb-4">
81
+ <span className="px-2 py-1 rounded border border-white/10 text-[10px] uppercase tracking-wider text-white/50">
82
+ {node.role}
83
+ </span>
84
+ <div className="text-[10px] font-mono text-white/50">
85
+ {node.metric}: <span className="text-white">{node.value}%</span>
86
+ </div>
87
+ </div>
88
+
89
+ <h3 className="text-xl font-medium text-white mb-2">{node.name}</h3>
90
+ <p className="text-xs text-white/50 leading-relaxed line-clamp-2">
91
+ {node.desc}
92
+ </p>
93
+
94
+ {!isLocked && (
95
+ <div className="mt-6 flex items-center text-[10px] text-amber-500 font-mono uppercase tracking-wider">
96
+ Analyze Dynamic <ArrowUpRight className="w-3 h-3 ml-1" />
97
+ </div>
98
+ )}
99
+ </Card>
100
+ </motion.div>
101
+ );
102
+ })}
103
+ </div>
104
+ );
105
+ }