// Federations directory + federation detail function FederationsPage() { const { go } = CTSCShell.useNav(); const { data } = CTSCStore.useStore(); const { FedLogo } = CTSCShell; const [q, setQ] = React.useState(''); const [status, setStatus] = React.useState('All'); const statuses = ['All', 'Transformation reported', 'Awaiting report', 'SASCOC affiliated']; const match = (f) => status === 'All' ? true : status === 'Transformation reported' ? !!f.tr : status === 'Awaiting report' ? !f.tr : f.sascoc; const list = data.federations.filter(f => match(f) && (f.name.toLowerCase().includes(q.toLowerCase()) || f.sport.toLowerCase().includes(q.toLowerCase()) || (f.abbr || '').toLowerCase().includes(q.toLowerCase()))); return (
setQ(e.target.value)} placeholder="Search federations or sports…" style={{ flex: 1, minWidth: 240, fontFamily: 'inherit', fontSize: 15, padding: '12px 16px', border: '1.5px solid var(--line)', borderRadius: 6, background: '#fff' }} />
{statuses.map(r => )}
{list.length} federation{list.length !== 1 ? 's' : ''}
{list.map((f, i) => ( ))}
); } function FederationDetail({ id }) { const { go } = CTSCShell.useNav(); const { data, user } = CTSCStore.useStore(); const { fmtDate } = CTSCStore; const { Photo, Avatar, StatusBadge, FedLogo } = CTSCShell; const f = data.federations.find(x => x.id === id); if (!f) return ; const heroes = data.heroes.filter(h => h.fedId === id && h.status === 'Approved'); const events = data.events.filter(e => e.fedId === id && e.status === 'Approved'); const news = data.news.filter(n => n.fedId === id && n.status === 'Approved'); const TR = f.tr ? [['Women & girls', f.tr.women], ['Youth (U18)', f.tr.youth], ['Para / disability', f.tr.disability]] : null; return (
{f.sport}{f.sascoc ? ' · SASCOC Member' : ''}

{f.name}

{f.abbr !== '—' ? f.abbr + ' · ' : ''}{f.region} · {f.tr ? 'Transformation reported' : 'Transformation report outstanding'}

About

{f.about}

{heroes.length > 0 && <>

Heroes

{heroes.map(h => ( ))}
}

Upcoming Events

{events.length ? (
{events.map(e => ( ))}
) :

No upcoming events listed.

} {news.length > 0 && <>

Federation News

{news.map(n => ( ))}
}
{/* sidebar */}
); } function Row({ k, v }) { return
{k}{v}
; } function ContactBlock({ role, name, phone, email }) { return (
{role}
{name &&
{name}
} {phone &&
{phone}
} {email && {email}}
); } // shared page header function PageHead({ title, sub }) { return (

{title}

{sub &&

{sub}

}
); } window.FederationsPage = FederationsPage; window.FederationDetail = FederationDetail; window.PageHead = PageHead;