@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 1.09 kB
JavaScript
import React from'react';import PropTypes from'prop-types';import{Accordion}from'@shopgate/pwa-ui-material';import{i18n}from'@shopgate/engage/core/helpers';import Lists from"./Lists";import ListsHTML from"./ListsHTML";import Wrapper from"./Wrapper";import{accordion}from"./style";/**
* Renders the properties as groups.
* @param {Object} props The component props.
* @returns {JSX}
*/var GroupedProperties=function GroupedProperties(_ref){var groups=_ref.groups;return groups.map(function(group){return React.createElement("div",{key:group.key,className:accordion},React.createElement(Accordion,{renderLabel:function renderLabel(){return group.label||i18n.text("product.displayGroups.".concat(group.key));},testId:"product-properties-group-".concat(!group.label?group.key:"".concat(group.key,"-").concat(group.label))},React.createElement(Wrapper,{dense:true,groupName:group.label||group.key,htmlOnly:group.htmlOnly},group.htmlOnly?React.createElement(ListsHTML,{properties:group.properties}):React.createElement(Lists,{properties:group.properties}))));});};export default GroupedProperties;