import React from "react"; import { t } from "../i18n"; import { useExcalidrawContainer } from "./App"; export const Section: React.FC<{ heading: string; children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode); className?: string; }> = ({ heading, children, ...props }) => { const { id } = useExcalidrawContainer(); const header = (

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

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