Spaces:
Sleeping
Sleeping
Create src/app/dashboard/page.tsx
Browse files- src/app/dashboard/page.tsx +108 -0
src/app/dashboard/page.tsx
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client';
|
| 2 |
+
import { useEffect, useState } from 'react';
|
| 3 |
+
|
| 4 |
+
const INSIGHTS = [
|
| 5 |
+
{ title: 'Emotional Authority', desc: 'Wait for emotional clarity before major decisions. Your wave is the oracle.', gate: '6' },
|
| 6 |
+
{ title: 'Splenic Awareness', desc: 'In-the-moment intuition is your strongest signal. Trust the first impulse.', gate: '57' },
|
| 7 |
+
{ title: 'Root Pressure', desc: 'You transmit urgency to others. Ground before engaging.', gate: '52' },
|
| 8 |
+
];
|
| 9 |
+
|
| 10 |
+
const METRICS = [
|
| 11 |
+
{ label: 'System Load', value: 78, unit: '%', color: 'bg-violet-500' },
|
| 12 |
+
{ label: 'Signal Clarity', value: 91, unit: '%', color: 'bg-cyan-500' },
|
| 13 |
+
{ label: 'Coherence', value: 64, unit: '%', color: 'bg-amber-500' },
|
| 14 |
+
{ label: 'Safety', value: 85, unit: '%', color: 'bg-green-500' },
|
| 15 |
+
];
|
| 16 |
+
|
| 17 |
+
export default function DashboardPage() {
|
| 18 |
+
const [user, setUser] = useState<Record<string,string> | null>(null);
|
| 19 |
+
const [tick, setTick] = useState(0);
|
| 20 |
+
|
| 21 |
+
useEffect(() => {
|
| 22 |
+
const stored = localStorage.getItem('defrag_user');
|
| 23 |
+
if (stored) setUser(JSON.parse(stored));
|
| 24 |
+
const id = setInterval(() => setTick(t => t + 1), 3000);
|
| 25 |
+
return () => clearInterval(id);
|
| 26 |
+
}, []);
|
| 27 |
+
|
| 28 |
+
const currentGate = 10 + (tick % 54);
|
| 29 |
+
|
| 30 |
+
return (
|
| 31 |
+
<div className="min-h-screen p-6 max-w-6xl mx-auto">
|
| 32 |
+
{/* Header */}
|
| 33 |
+
<div className="flex items-start justify-between mb-8">
|
| 34 |
+
<div>
|
| 35 |
+
<p className="text-xs font-mono text-slate-600 tracking-widest uppercase mb-1">System Status</p>
|
| 36 |
+
<h1 className="text-3xl font-light text-slate-100">
|
| 37 |
+
{user?.name ? `${user.name}'s` : 'Your'} Dashboard
|
| 38 |
+
</h1>
|
| 39 |
+
{user?.hdType && (
|
| 40 |
+
<p className="text-sm text-violet-400 font-mono mt-1">{user.hdType} • {user.sunGate || 'Gate Unknown'}</p>
|
| 41 |
+
)}
|
| 42 |
+
</div>
|
| 43 |
+
<div className="text-right">
|
| 44 |
+
<div className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-green-950 border border-green-800 text-green-400 text-xs font-mono">
|
| 45 |
+
<span className="w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse" />
|
| 46 |
+
ONLINE
|
| 47 |
+
</div>
|
| 48 |
+
<p className="text-xs text-slate-700 font-mono mt-1">Gate {currentGate} active</p>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
|
| 52 |
+
{/* Metrics grid */}
|
| 53 |
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
|
| 54 |
+
{METRICS.map(m => (
|
| 55 |
+
<div key={m.label} className="p-4 rounded-lg border border-[#1e1e2e] bg-[#0d0d14]">
|
| 56 |
+
<p className="text-xs font-mono text-slate-600 uppercase tracking-wider mb-3">{m.label}</p>
|
| 57 |
+
<div className="flex items-end gap-1 mb-2">
|
| 58 |
+
<span className="text-3xl font-mono text-slate-100">{m.value}</span>
|
| 59 |
+
<span className="text-slate-600 text-sm mb-0.5">{m.unit}</span>
|
| 60 |
+
</div>
|
| 61 |
+
<div className="h-1 bg-slate-900 rounded-full overflow-hidden">
|
| 62 |
+
<div className={`h-full ${m.color} rounded-full transition-all duration-1000`} style={{ width: `${m.value}%` }} />
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
| 65 |
+
))}
|
| 66 |
+
</div>
|
| 67 |
+
|
| 68 |
+
{/* Insight cards */}
|
| 69 |
+
<div className="mb-8">
|
| 70 |
+
<p className="text-xs font-mono text-slate-600 tracking-widest uppercase mb-4">Active Insights</p>
|
| 71 |
+
<div className="grid md:grid-cols-3 gap-4">
|
| 72 |
+
{INSIGHTS.map(ins => (
|
| 73 |
+
<div key={ins.title} className="p-5 rounded-lg border border-[#1e1e2e] bg-[#0d0d14] hover:border-violet-800/50 transition-colors">
|
| 74 |
+
<div className="flex items-start justify-between mb-3">
|
| 75 |
+
<span className="text-xs font-mono text-violet-400 tracking-wider">{ins.title}</span>
|
| 76 |
+
<span className="text-xs font-mono text-slate-700 border border-slate-800 px-1.5 py-0.5 rounded">
|
| 77 |
+
G{ins.gate}
|
| 78 |
+
</span>
|
| 79 |
+
</div>
|
| 80 |
+
<p className="text-sm text-slate-400 leading-relaxed">{ins.desc}</p>
|
| 81 |
+
</div>
|
| 82 |
+
))}
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
{/* Quick nav */}
|
| 87 |
+
<div className="grid md:grid-cols-3 gap-4">
|
| 88 |
+
{[
|
| 89 |
+
{ href: '/relationships', label: 'Relational Map', sub: 'View connection geometry' },
|
| 90 |
+
{ href: '/oracle', label: 'Oracle Guidance', sub: 'Spoken AI insights' },
|
| 91 |
+
{ href: '/onboarding', label: 'Update Profile', sub: 'Recalibrate your node' },
|
| 92 |
+
].map(nav => (
|
| 93 |
+
<a
|
| 94 |
+
key={nav.href}
|
| 95 |
+
href={nav.href}
|
| 96 |
+
className="p-4 rounded-lg border border-[#1e1e2e] bg-[#0d0d14] hover:border-violet-800/50 flex items-center justify-between group transition-colors"
|
| 97 |
+
>
|
| 98 |
+
<div>
|
| 99 |
+
<p className="text-sm text-slate-200 group-hover:text-violet-400 transition-colors">{nav.label}</p>
|
| 100 |
+
<p className="text-xs text-slate-600">{nav.sub}</p>
|
| 101 |
+
</div>
|
| 102 |
+
<span className="text-slate-700 group-hover:text-violet-400 transition-colors">→</span>
|
| 103 |
+
</a>
|
| 104 |
+
))}
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
);
|
| 108 |
+
}
|