// Drawer.jsx - org detail drawer // // Deprioritised data points are hidden from the passport per feedback // (Andrea & Rintati). These can be inferred from the value chain, so the // passport stays focused on what the maps actually use: // Global view - hide budget, size, funding source, start year, type of // financial support (financial instruments). // Regional view (India) - additionally hide "Regions active"; the rest of // the deprioritised set is hidden too. // `regional` is passed from app.jsx based on the active view. function Drawer({ org, allOrgs, regional = false, onClose, onPickOrg }) { if (!org) return null; const { facets } = window.INITIATIVES_DATA; const typeKey = window.TYPE_KEY[org.type] || 'ngo'; const typeShort = facets.types.short[org.type] || ''; // Map collaborators to known orgs (fuzzy match) const knownLookup = new Map(); for (const o of allOrgs) knownLookup.set(o.name.toLowerCase(), o); const findKnown = (name) => { const ln = name.toLowerCase(); for (const [k, v] of knownLookup) { if (k === ln || k.includes(ln) || ln.includes(k.split('(')[0].trim())) return v; } return null; }; const stop = (e) => e.stopPropagation(); return ( <>
{typeShort} · {facets.types.labels[org.type] || org.type}

{org.name}

{/* Budget / Active since / Size removed - deprioritised data points (Andrea & Rintati), inferable from the value chain. */}
About

{org.description}

{/* Regions active hidden in the regional (India) view - deprioritised there (Andrea & Rintati). Kept in the global view. */} {!regional && (
Regions active
{org.regions.map((r) => ( {facets.regions.labels[r] || r} ))}
)} {(() => { // Value-chain segment tags. Global orgs carry an array in `vcRaw`; // India orgs store a ';'-separated string in `rawVC`. We surface the // raw tags (incl. "Tech provision & manufacturers", "Policymakers & // regulators") so the role is still visible in the passport even // though those no longer have dedicated columns in the table. const segs = (org.vcRaw && org.vcRaw.length ? org.vcRaw : (org.rawVC ? String(org.rawVC).split(/[;,]/).map(s => s.trim()) : []) ).filter(v => v && !v.startsWith('N/A')); if (segs.length === 0) return null; return (
Energy ecosystem segments
{segs.map((v) => ( {v} ))}
); })()}
Barriers addressed
{org.barriers.map((b) => ( {b} ))}
{org.collaborators.length > 0 && (
Publicly works with
{org.collaborators.map((c, i) => { const known = findKnown(c); return (
known && onPickOrg(known)} style={{ cursor: known ? 'pointer' : 'default' }} > {c}
); })}
)} {org.source && (
Source
{org.source}
)}
); } window.Drawer = Drawer;