Files
homaroma/apps/website/src/lib/cms-sections.ts
T
2026-06-21 07:04:03 -04:00

19 lines
683 B
TypeScript

import type { PageSection } from '@homaroma/types'
const announcementTypes = new Set(['ANNOUNCEMENT_BAR'])
const heroTypes = new Set(['HERO', 'BANNER'])
function sectionType(section: PageSection) {
return section.type.toUpperCase()
}
export function splitCmsLayoutSections(sections: PageSection[]) {
const activeSections = sections.filter((section) => section.isActive)
return {
announcementSections: activeSections.filter((section) => announcementTypes.has(sectionType(section))),
heroSections: [], // Keep for backwards compatibility with page components
bottomSections: activeSections.filter((section) => !announcementTypes.has(sectionType(section))),
}
}