design-comuni-plone-theme
Version:
Volto Theme for Italia design guidelines
28 lines (22 loc) • 577 B
JSX
import React from 'react';
import config from '@plone/volto/registry';
const ContentTypeViewSections = ({ content, defaultSections }) => {
if (!content) {
return <></>;
}
const sections =
config.settings?.italiaThemeViewsConfig?.[content['@type']]?.sections ??
defaultSections;
return sections?.length > 0 ? (
sections.map((section, i) => (
<section.component
content={content}
{...section.props}
key={`${content['@id']}-section-${i}`}
/>
))
) : (
<></>
);
};
export default ContentTypeViewSections;