// Hub-level "Get started with a template" empty state — used for a hub whose // Dashboard tab has no artifact yet (Sales, Operations today). Mirrors the // New-Record templates picker (tpl-grid / tpl-card, same CSS) but surfaces a // curated set of templates for the hub, plus two follow-on paths: generate a // custom dashboard with the agent, or pick an existing artifact from the // hub's Library. // // Deliberately references TemplateThumb / ProxaP / icons as bare identifiers // (not destructured at module scope) so load order relative to templates.jsx // and chat_panel.jsx doesn't matter — they only need to exist on window by // the time this component actually renders. const HUB_TEMPLATE_CATALOG = { Sales: [ { key: 'pipeline', title: 'Pipeline & bookings overview', thumb: 'kpi' }, { key: 'winloss', title: 'Win / loss review', thumb: 'bars' }, { key: 'territory', title: 'Territory performance', thumb: 'area' }, { key: 'quota', title: 'Quota attainment', thumb: 'waterfall' }, { key: 'renewals', title: 'Renewals & expansion', thumb: 'grid' }, { key: 'leaderboard', title: 'Rep leaderboard', thumb: 'kpi' }, ], Operations: [ { key: 'opsoverview', title: 'Operations performance overview', thumb: 'kpi' }, { key: 'utilization', title: 'Utilization & margin', thumb: 'area' }, { key: 'resourcing', title: 'Resource allocation', thumb: 'grid' }, { key: 'riskreg', title: 'Delivery risk register', thumb: 'bars' }, { key: 'cotracker', title: 'Change order tracker', thumb: 'waterfall' }, { key: 'capacity', title: 'Capacity planning', thumb: 'kpi' }, ], }; const HUB_AGENT_PROMPT = { Sales: 'Build a Sales dashboard from this hub\u2019s knowledge base.', Operations: 'Build an Operations dashboard from this hub\u2019s knowledge base.', }; function HubTemplatesEmpty({ hub, onOpenAgentChat, onPickLibrary }) { const templates = HUB_TEMPLATE_CATALOG[hub] || HUB_TEMPLATE_CATALOG.Sales; const handleTemplateClick = (tpl) => { if (onOpenAgentChat) onOpenAgentChat(`Build a ${tpl.title} dashboard for the ${hub} hub.`); }; const handleAgent = () => { if (onOpenAgentChat) onOpenAgentChat(HUB_AGENT_PROMPT[hub] || HUB_AGENT_PROMPT.Sales); }; return (
Add a Dashboard
{templates.map((tpl) => ( ))}
or
); } window.HubTemplatesEmpty = HubTemplatesEmpty;