import type { ReactNode } from "react" import { SHOW_COPY_PLACEHOLDERS } from "./placeholder" import { str, type Section } from "./types" interface SectionBandProps { section: Section /** Whether the section body produced any content. */ hasContent: boolean children: ReactNode } /** * Shell for a marketing band: the `
` wrapper, its heading and its * subtitle. Renders nothing at all when the section has neither content nor a * heading, so an unfilled page degrades to just its hero. */ export function SectionBand({ section, hasContent, children }: SectionBandProps) { const title = str(section.title) const subtitle = str(section.subtitle) if (!hasContent && !title && !subtitle) { if (!SHOW_COPY_PLACEHOLDERS) return null return (
TODO: {section.type}
) } return (
{(title || subtitle) && (
{title &&

{title}

} {subtitle && (

{subtitle}

)}
)} {children}
) }