import { classes, isFalsy, pureComponentHooks } from 'common/react'; import { Box } from './Box'; export const Section = props => { const { className, title, level = 1, buttons, content, children, ...rest } = props; const hasTitle = !isFalsy(title) || !isFalsy(buttons); const hasContent = !isFalsy(content) || !isFalsy(children); return ( {hasTitle && (
{title}
{buttons}
)} {hasContent && (
{content} {children}
)}
); }; Section.defaultHooks = pureComponentHooks;