// ============================================================ // page-dashboard.jsx — KPI strip + time-series chart + // pipeline funnel + recent activity + team leaderboard. // Theme-aware so it adapts to dark rail chrome. // ============================================================ const DashboardBody = ({ theme = "light" }) => { const dark = theme === "dark"; const c = dark ? { bg: "#0f0f14", panel: "#13131a", border: "#ffffff10", text: "#e8e8ee", subtext: "#9a9aa6", muted: "#6a6a78", grid: "#ffffff08", accent: "#7a78ff", up: "#22c55e", down: "#ff4d5e", } : { bg: "#fafaf9", panel: "#ffffff", border: "#ebebe6", text: "#111", subtext: "#5a5a5e", muted: "#8a8a90", grid: "#eeeee9", accent: "#5e5cff", up: "#22c55e", down: "#ff4d5e", }; // Synthetic but consistent daily series, weekday-shaped const days = ["M","T","W","T","F","S","S","M","T","W","T","F","S","S"]; const series = [42,58,71,64,79,32,28, 51,68,82,75,90,38,33]; const max = Math.max(...series); // Funnel data const funnel = [ { stage: "New", n: 184, v: "€2.1m" }, { stage: "Qualified", n: 96, v: "€1.4m" }, { stage: "Proposal", n: 42, v: "€780k" }, { stage: "Negotiation", n: 19, v: "€420k" }, { stage: "Closed-won", n: 11, v: "€286k" }, ]; const fmax = funnel[0].n; const Avatar = ({ name, color = "#d4b8a8", size = 22 }) => (
{name}
); return (
{/* Header */}
Workspace dashboard

Good afternoon, Mira

3 deals moved stage today · 12 unread in Inbox · 1 task overdue
Last 14 days
{/* KPI strip */}
{[ { l: "Revenue · MTD", v: "€286,420", d: "+18.4%", up: true, spark: [20,28,24,36,30,42,52,48,58,62,70,82] }, { l: "Active deals", v: "168", d: "+12", up: true, spark: [40,42,45,46,49,52,54,56,58,60,62,65] }, { l: "Win rate · 30d", v: "34.2%", d: "−1.1%", up: false, spark: [60,58,55,52,54,50,48,45,46,42,38,36] }, { l: "Pipeline ratio", v: "4.8×", d: "healthy", up: true, spark: [50,48,52,55,53,58,56,60,62,65,63,68] }, ].map(k => { const sm = Math.max(...k.spark), sn = Math.min(...k.spark); const pts = k.spark.map((v, i) => { const x = (i / (k.spark.length - 1)) * 100; const y = 30 - ((v - sn) / (sm - sn || 1)) * 26 - 2; return `${x},${y}`; }).join(" "); return (
{k.l} {k.d}
{k.v}
); })}
{/* Chart + funnel */}
{/* Time-series */}
Revenue, daily
Bookings · GBP closed-won
{["Day", "Week", "Month"].map((t, i) => ( {t} ))}
{/* Gridlines */} {[0, 0.25, 0.5, 0.75, 1].map(p => (
))} {/* Bars */}
{series.map((v, i) => (
))}
{/* Annotation */}
€42k · today
{days.map((d, i) => ( {d} ))}
{/* Funnel */}
Pipeline funnel
Q2 · 168 deals
{funnel.map((f, i) => { const w = (f.n / fmax) * 100; const colors = ["#5e5cff", "#7a78ff", "#9b99ff", "#bcb9ff", "#22c55e"]; return (
{f.stage}
{f.n} {f.v}
); })}
{/* Activity + leaderboard */}
Recent activity
View all →
{[ { who: "MR", c: "#d4b8a8", n: "Mira Reyes", v: "moved", w: <>Q3 — Carrier API to Negotiation, t: "2m ago" }, { who: "TR", c: "#c8e8a8", n: "Theo Roux", v: "logged a call with", w: <>Sun Kim · Northstar, t: "14m" }, { who: "DP", c: "#a8c8e8", n: "Devi Patel", v: "closed", w: <>Halcyon · Pro renewal · €24,000, t: "1h" }, { who: "MR", c: "#d4b8a8", n: "Mira Reyes", v: "created a deal", w: <>Brooke Foods — Q3 pilot, t: "2h" }, { who: "SK", c: "#e8a87c", n: "Sun Kim", v: "added 4 contacts to", w: <>Kestrel, t: "3h" }, ].map((a, i) => (
{a.n} {a.v} {a.w}
{a.t}
))}
Team · this month
By bookings
{[ { i: "MR", c: "#d4b8a8", n: "Mira Reyes", v: 124, d: "€124k", p: 100 }, { i: "DP", c: "#a8c8e8", n: "Devi Patel", v: 86, d: "€86k", p: 70 }, { i: "TR", c: "#c8e8a8", n: "Theo Roux", v: 62, d: "€62k", p: 50 }, { i: "SK", c: "#e8a87c", n: "Sun Kim", v: 48, d: "€48k", p: 39 }, ].map(t => (
{t.n} {t.d}
))}
); }; window.DashboardBody = DashboardBody;