import React from "react"; import { t } from "../i18n"; interface SectionProps extends React.HTMLProps { heading: string; children: React.ReactNode | ((header: React.ReactNode) => React.ReactNode); } export const Section = ({ heading, children, ...props }: SectionProps) => { const header = (

{t(`headings.${heading}`)}

); return (
{typeof children === "function" ? ( children(header) ) : ( <> {header} {children} )}
); };