// ============================================================ // MOORE AI v13 — DASHBOARD TAB // Requires: shared/utils.js, shared/components.jsx loaded first // ============================================================ const DashboardView = ({ crmData, setActiveTab, setSelectedLead, setChatOpen, setChatMode, calEvents, fetchCalendar, handleSendMessage, actionItems, activeCalls }) => { const { useEffect } = React; useEffect(() => { if (calEvents.length === 0) fetchCalendar(); }, []); const recentOpps = crmData.opportunities.slice(0, 5); return (
{/* Header */}
Real-time Telemetry

Command
Center

Good morning,
Jake Moore
{new Date().toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric' })}
{/* Stats Grid */}
{/* Two columns */}
{/* Recent Pipeline */}
Recent Pipeline Activity
{recentOpps.length === 0 ?
Loading pipeline...
: recentOpps.map(opp => (
{ setActiveTab('pipeline'); setSelectedLead(opp); }} className="flex items-center gap-4 px-6 py-4 hover:bg-slate-800/20 cursor-pointer transition-colors group">
{opp.name}
{opp.contact} · {opp.stageName}
{fmt$(opp.value)}
))}
{/* Right column */}
{/* Upcoming events */}
Upcoming
{calEvents.slice(0, 3).length === 0 ?
No upcoming events
: calEvents.slice(0, 3).map(ev => (
{ev.title}
{fmtDate(ev.startTime)} · {fmtTime(ev.startTime)}
))}
{/* Active calls widget */} {activeCalls && activeCalls.length > 0 && (
Live Calls
{activeCalls.map((c,i) => (
{c.contactName} · {c.status}
))}
)} {/* Quick Commands */}
Quick Commands
Sends to Jake AI
{[ { cmd: "Summarize my pipeline", icon: "bar-chart-2" }, { cmd: "Who needs follow-up?", icon: "clock" }, { cmd: "Who's closest to closing?", icon: "target" }, { cmd: "Call my top lead", icon: "phone" }, { cmd: "Show open deals by value", icon: "trending-up" }, { cmd: "Create action items from my pipeline", icon: "check-square" }, ].map(({ cmd, icon }, i) => ( ))}
{/* Action items preview */} {actionItems && actionItems.filter(a => !a.done).length > 0 && (
Pending Actions
{actionItems.filter(a => !a.done).slice(0,3).map((item,i) => (
{item.title}
))}
)}
); };