);
}
// ─── Page router ──────────────────────────────────────────────────
function PageRouter() {
const { page, id } = useCurrentPage();
switch (page) {
case 'home':
return ;
case 'artists':
return ;
case 'artist-profile':
// In production: fetch artist by slug from WordPress, then render ProfileArtist.
// For now, demo both profile types by slug.
if (id === 'jacob-steinmiller') return ;
return ;
case 'events':
return ; // list view is the primary events index
case 'event-detail':
// Route by id/slug to the correct template.
// Drop-in / multi-site Open Studios campaign
if (id === 'spring-open-studios' || id === 'spring-os' || id === 'fall-os') return ;
// Gallery opening / exhibit
if (id === 'ss-open' || (id && (id.includes('senior') || id.includes('exhibit') || id.includes('gallery') || id.includes('opening')))) {
return ;
}
// Default: class or concert
return ;
case 'news':
return ;
case 'news-article': {
// Open calls and announcements use the sidebar template
const announcementIds = ['qw-2027', 'draw-series', 'hours-summer', 'board-spring', 'summer-call', 'students-25'];
if (id && (announcementIds.includes(id) || id.includes('call') || id.includes('apply') || id.includes('grant'))) {
return ;
}
return ;
}
case 'about':
return ;
case 'contact':
return ;
default:
return ;
}
}
// ─── App wrapper ──────────────────────────────────────────────────
function AppContent() {
const { path } = useRouter();
// Signal loading complete on first mount
React.useEffect(() => {
window.dispatchEvent(new CustomEvent('roco:ready'));
}, []);
// Re-signal on route changes so analytics can track page views
React.useEffect(() => {
window.dispatchEvent(new CustomEvent('roco:navigate', { detail: { path } }));
}, [path]);
return (
);
}
function App() {
return (
);
}
// Expose utilities globally so non-React code (push banner buttons, etc.) can use them
Object.assign(window, { showToast, NewsletterForm });
ReactDOM.createRoot(document.getElementById('root')).render();