// ============================================================ // crm-pages.jsx — Cadence CRM · in-app screens // ------------------------------------------------------------ // Every page renders INSIDE SidebarShell (far-left sidebar). // Built on vibn-ai-templates components. Light/minimal theme. // // Pages: CRMHome, CRMPeople, CRMRecord, CRMPipeline, // CRMInbox, CRMReports, CRMSettings. // ============================================================ const CRM_USER = { name: "Mira Reyes", email: "mira@northwind.io", color: "#d4b8a8" }; // Sidebar config — pass the active id, get the sections array. const crmSections = (active) => [ { items: [ { id: "home", label: "Home", icon: "home", active: active === "home" }, { id: "inbox", label: "Inbox", icon: "inbox", count: 8, active: active === "inbox" }, { id: "tasks", label: "My tasks", icon: "check", count: 3, active: active === "tasks" }, ]}, { title: "Records", items: [ { id: "companies", label: "Companies", icon: "building", active: active === "companies" }, { id: "people", label: "People", icon: "people", active: active === "people" }, { id: "deals", label: "Deals", icon: "target", count: 12, active: active === "deals" }, ]}, { title: "Workspace", items: [ { id: "reports", label: "Reports", icon: "bar", active: active === "reports" }, { id: "automations", label: "Automations", icon: "workflow", active: active === "automations" }, { id: "settings", label: "Settings", icon: "settings", active: active === "settings" }, ]}, ]; // Wrap a page body in the shell with the right nav item active const CRMShell = ({ active, children }) => ( }} sections={crmSections(active)} user={CRM_USER} search="Search or jump to…"> {children} ); // Reusable page header bar (title + actions row) const PageBar = ({ title, sub, breadcrumb, actions }) => (
{breadcrumb &&
{breadcrumb}
}

{title}

{sub &&
{sub}
}
{actions &&
{actions}
}
); const Scroll = ({ children, pad = 28 }) => (
{children}
); // ── small stat tile ────────────────────────────────────────── const Stat = ({ label, value, delta, up, spark }) => (
{label} {delta && {up ? "↑" : "↓"} {delta}}
{value}
{spark && ( )}
); const sparkUp = "0,24 12,20 24,22 36,15 48,17 60,10 72,12 84,6 100,2"; const sparkDn = "0,6 14,8 28,7 42,12 56,11 70,16 84,15 100,20"; // ============================================================ // 1 · HOME // ============================================================ const CRMHome = () => ( }/> {/* KPI row */}
{/* Pipeline by stage */} View board →}/>
{[ ["Lead", 5, "$420K", 100], ["Qualified", 3, "$365K", 78], ["Proposal", 2, "$280K", 60], ["Negotiation", 1, "$148K", 32], ["Won", 1, "$96K", 22], ].map(([name, n, val, w]) => (
{name} {n} deals · {val}
))}
{/* Today's tasks */} All tasks}/>
{[ ["Follow up with Acme Robotics", "Overdue · 2d", true, "danger"], ["Send proposal to Halcyon", "Due 2:00pm", false, "warn"], ["Call Sun at Northstar", "Due 4:30pm", false, "neutral"], ["Prep QBR deck for Kestrel", "Tomorrow", false, "neutral"], ].map(([t, when, overdue, tone], i) => (
{t}
{when}
))}
{/* Recent activity */} }/>
{[ ["MR", "#d4b8a8", "Mira Reyes", "moved", "Acme — Renewal '26 to Negotiation", "12m"], ["TR", "#c8e8a8", "Theo Roux", "logged a call with", "Sun Kim · Northstar", "1h"], ["DP", "#a8c8e8", "Devi Patel", "won", "Halcyon · Pro renewal · $24K", "3h"], ["SK", "#e8a87c", "Sun Ortiz", "added 4 contacts to", "Kestrel", "Yesterday"], ].map(([i, c, who, verb, obj, t], idx) => (
{who} {verb} {obj}
{t}
))}
); // ============================================================ // 2 · PEOPLE (contacts table) // ============================================================ const CRMPeople = () => { const people = [ { id: 1, name: "Iris Tanaka", color: "#e8a87c", title: "Head of Engineering", company: "Acme Robotics", stage: "Customer", owner: "MR", last: "2h" }, { id: 2, name: "Daniel Owusu", color: "#a8c8e8", title: "VP Product", company: "Acme Robotics", stage: "Customer", owner: "MR", last: "Yesterday" }, { id: 3, name: "Sun Kim", color: "#c8e8a8", title: "VP Operations", company: "Northstar", stage: "Lead", owner: "TR", last: "3d" }, { id: 4, name: "Priya Nair", color: "#c8a8e8", title: "COO", company: "Halcyon", stage: "Prospect", owner: "DP", last: "1w" }, { id: 5, name: "Marco Lindqvist", color: "#e8c8a8", title: "Procurement", company: "Kestrel", stage: "Customer", owner: "MR", last: "4d" }, { id: 6, name: "Naila Choudhury", color: "#a8e8c8", title: "CFO", company: "Mossbank", stage: "Lead", owner: "TR", last: "2w" }, { id: 7, name: "Henri Lamarck", color: "#e8a8c8", title: "Founder", company: "Verra", stage: "Prospect", owner: "DP", last: "5d" }, { id: 8, name: "Emi Hara", color: "#d4b8a8", title: "Head of Sales", company: "Tide Co.", stage: "Customer", owner: "MR", last: "1d" }, ]; const stageTone = { Customer: "success", Lead: "accent", Prospect: "warn" }; return ( }/> {/* Filter row */}
} style={{ width: 260, padding: "6px 10px" }}/> {["Stage", "Owner", "Company", "Last activity"].map(f => (
{f}
))}
(
{r.name}
{r.title}
)}, { key: "company", label: "Company", render: r => ( {r.company[0]} {r.company} )}, { key: "stage", label: "Stage", render: r => {r.stage} }, { key: "owner", label: "Owner", render: r => }, { key: "last", label: "Last activity" }, { key: "act", label: "", align: "right", width: 40, render: () => }, ]} rows={people} /> ); }; // ============================================================ // 3 · COMPANY RECORD (detail) // ============================================================ const CRMRecord = () => ( }/>
{/* Details rail */}
A
Customer Tier 1
acme-robotics.io
{[ ["Industry", "Industrial automation"], ["Employees", "210"], ["Owner", "Mira Reyes"], ["Renewal", "Sept 1, 2026"], ["ARR", "$148,000"], ["Health", "Strong"], ].map(([k, v]) => (
{k} {v}
))}
Open deals · 3
{[ ["Renewal '26", "$148K", "Negotiation", 70], ["Vision platform", "$62K", "Discovery", 30], ["Edge SDK pilot", "$24K", "Proposal", 45], ].map(([n, v, s, p]) => (
{n} {v}
{s}{p}%
60 ? "var(--success)" : "var(--accent)" }}/>
))}
{/* Main: tabs + activity */}
{/* KPIs */}
{[["Pipeline", "$234K", "+$12K 30d"], ["Lifetime", "$420K", "won"], ["Open deals", "3", "1 stalled"], ["Health", "82/100", "stable"]].map(([l, v, s]) => (
{l}
{v}
{s}
))}
{/* Composer */}
{/* Timeline */}
{[ ["var(--success)", "Deal moved to Negotiation", "Mira · Renewal '26 · $148,000", "2h ago"], ["var(--accent)", "Email sent · proposal v4", "To Iris, Daniel — opened 6 times", "Yesterday"], ["var(--warn)", "Call logged · 32 min", "Theo — walkthrough with ops lead", "2d ago"], ["var(--text-3)", "Note added", "They need SSO + SCIM by Sept — gating item", "4d ago"], ].map(([dot, t, sub, when], i) => (
{t} {when}
{sub}
))}
); // ============================================================ // 4 · PIPELINE (deals kanban) // ============================================================ const CRMPipeline = () => { const columns = [ { name: "Lead", total: "$420K", tone: "var(--text-3)", deals: [ { co: "Mossbank", title: "New logo · Platform", val: "$120K", owner: "TR", color: "#a8e8c8", days: 3, tags: ["Inbound"] }, { co: "Verra", title: "Vision pilot", val: "$84K", owner: "DP", color: "#e8a8c8", days: 8 }, { co: "Tide Co.", title: "Expansion", val: "$96K", owner: "MR", color: "#d4b8a8", days: 1, tags: ["Warm"] }, ]}, { name: "Qualified", total: "$365K", tone: "var(--accent)", deals: [ { co: "Northstar", title: "Carrier API", val: "$148K", owner: "MR", color: "#c8e8a8", days: 5, tags: ["Champion"] }, { co: "Kestrel", title: "Renewal + seats", val: "$120K", owner: "TR", color: "#a8c8e8", days: 12 }, ]}, { name: "Proposal", total: "$280K", tone: "var(--warn)", deals: [ { co: "Halcyon", title: "Pro renewal", val: "$180K", owner: "DP", color: "#c8a8e8", days: 2, tags: ["Sent"] }, { co: "Acme", title: "Edge SDK pilot", val: "$24K", owner: "MR", color: "#e8c8a8", days: 6 }, ]}, { name: "Negotiation", total: "$148K", tone: "#f59e0b", deals: [ { co: "Acme Robotics", title: "Renewal '26", val: "$148K", owner: "MR", color: "#e8a87c", days: 1, tags: ["Hot", "Closing"] }, ]}, { name: "Won", total: "$96K", tone: "var(--success)", deals: [ { co: "Lowell Works", title: "Annual plan", val: "$96K", owner: "TR", color: "#a8c8e8", days: 0, tags: ["Closed"] }, ]}, ]; return ( }/>
} style={{ width: 240, padding: "6px 10px" }}/> {["Owner", "Close date", "Value"].map(f => (
{f}
))}
{columns.map(col => (
{col.name} {col.deals.length} {col.total}
{col.deals.map((d, i) => (
{d.co[0]} {d.co}
{d.title}
{d.val}
{d.tags &&
{d.tags.map(t => {t})}
}
{d.days === 0 ? "Closed" : d.days === 1 ? "Closes today" : `${d.days}d to close`}
))}
))}
); }; // ============================================================ // 5 · INBOX // ============================================================ const CRMInbox = () => { const threads = [ ["IT", "#e8a87c", "Iris Tanaka", "Acme Robotics", "Re: Renewal terms — forwarding to Marco to start paper.", "10:42", 1, true], ["SK", "#c8e8a8", "Sun Kim", "Northstar", "Could we move the demo to Thursday?", "9:18", 1, false], ["DP", "#a8c8e8", "Devi Patel", "Internal", "Closed Halcyon! 🎉 Logging it now.", "Tue", 0, false], ["PN", "#c8a8e8", "Priya Nair", "Halcyon", "Thanks for the deck — a few questions inside.", "Mon", 0, false], ["ML", "#e8c8a8", "Marco Lindqvist", "Kestrel", "Procurement needs the security packet.", "May 28", 0, false], ]; return (
{/* List */}

Inbox

}/>
{["All", "Unread", "Assigned", "Deals"].map((t, i) => ( {t} ))}
{threads.map((th, i) => (
{th[2]} {th[5]}
{th[3]}
{th[4]}
{th[6] > 0 && }
))}
{/* Conversation */}
Iris Tanaka
iris@acme.io · Head of Engineering
{/* Linked deal */}
A
Acme — Renewal '26
Negotiation · $148,000 · closes Jun 12
Closing soon
{/* Messages */}
Today
{[ [false, "Hi Mira — the team reviewed the renewal terms and they look great. I'm forwarding to Marco in procurement to start the paperwork.", "10:14"], [true, "That's wonderful news, Iris. I'll send Marco the order form today. Anything he needs from our side to move quickly?", "10:28"], [false, "Just the security packet (SOC 2 + the SSO/SCIM details). If you can get that over, we should be able to close by the 12th.", "10:42"], ].map(([mine, body, time], i) => (
{!mine && }
{body}
{time}
))}
{/* Composer */}