diff --git a/frontend/src/addons/volto-plonede/src/customizations/volto/components/manage/Blocks/Listing/SummaryTemplate.jsx b/frontend/src/addons/volto-plonede/src/customizations/volto/components/manage/Blocks/Listing/SummaryTemplate.jsx new file mode 100644 index 0000000..6f8fcae --- /dev/null +++ b/frontend/src/addons/volto-plonede/src/customizations/volto/components/manage/Blocks/Listing/SummaryTemplate.jsx @@ -0,0 +1,59 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { + ConditionalLink, + Component, + FormattedDate, +} from '@plone/volto/components'; +import { flattenToAppURL } from '@plone/volto/helpers'; + +import { isInternalURL } from '@plone/volto/helpers/Url/Url'; + +const SummaryTemplate = ({ items, linkTitle, linkHref, isEditMode }) => { + let link = null; + let href = linkHref?.[0]?.['@id'] || ''; + + if (isInternalURL(href)) { + link = ( + + {linkTitle || href} + + ); + } else if (href) { + link = {linkTitle || href}; + } + + return ( + <> +
+ {items.map((item) => ( +
+ + +
+

{item.title || item.id}

+ {item.start && item.end && ( +

+ -{' '} + +

+ )} +

{item.description}

+
+
+
+ ))} +
+ + {link &&
{link}
} + + ); +}; + +SummaryTemplate.propTypes = { + items: PropTypes.arrayOf(PropTypes.any).isRequired, + linkMore: PropTypes.any, + isEditMode: PropTypes.bool, +}; + +export default SummaryTemplate;