/* ============================================================ Projects tile โ a Collection (Diligence, Contracts) is a project whose data products are grouped into SECTIONS via the accordion side menu (same rail as Model/Slides). Right pane = the selected DP as a card. These DPs are "empty" placeholders: the status is editable and the body prompts "Click to add content". ============================================================ */ // Eyebrow = the canonical unique DP id (window.dpId), NOT a section-coded // prefix โ so a diligence "financial" request can't collide with a finance // hub artifact, and Claude can reference any DP unambiguously. function CollectionsPanel() { var dil = (window.DILIGENCE || { sections: [] }).sections || []; var COLLECTIONS = { diligence: { label: 'Diligence', count: (window.DILIGENCE && window.DILIGENCE.stats && window.DILIGENCE.stats.items) || 85, sections: dil.map(function (s) { return { id: s.key, name: s.name, items: (s.items || []).map(function (it) { var dkey = 'dil_' + s.key + '_' + it.n; return { key: dkey, num: window.dpId(dkey), name: it.request, section: s.name, status: it.status || 'Requested' }; }) }; }), }, contracts: { label: 'Contracts', count: 2, sections: [{ id: 'contracts', name: 'Contracts', items: [ { key: 'con_register', num: window.dpId('con_register'), name: 'Tabular Review', section: 'Contracts', status: 'Published' }, { key: 'con_expiry', num: window.dpId('con_expiry'), name: 'Contract Expiration Schedule', section: 'Contracts', status: 'Published' }, ] }], }, }; var ORDER = ['diligence', 'contracts']; var C = { ink: 'var(--fg-dark)', base: 'var(--fg-base)', muted: 'var(--fg-muted)', line: 'var(--border-subtle, rgba(38,24,17,0.10))' }; var _c = React.useState('diligence'); var coll = _c[0], setColl = _c[1]; var active = COLLECTIONS[coll]; var _sel = React.useState(active.sections[0] && active.sections[0].id); var selSec = _sel[0], setSelSec = _sel[1]; var _st = React.useState({}); var statuses = _st[0], setStatuses = _st[1]; // {itemKey: status} var _canvas = React.useState(false); var canvasOpen = _canvas[0], setCanvasOpen = _canvas[1]; React.useEffect(function () { setSelSec(active.sections[0] && active.sections[0].id); }, [coll]); // Register a drawer record for each item into the CX_DASH `recordContent` // registry, so clicking a card opens the SAME drawer as the finance cards // (empty/compose state for these placeholder requests). React.useEffect(function () { var recs = {}; active.sections.forEach(function (sec) { sec.items.forEach(function (it) { var title = String(it.name).replace(/&/g, '&').replace(//g, '>'); recs[it.key] = { crumb: it.name, html: '