@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 1.21 kB
JavaScript
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React,{useCallback}from'react';import PropTypes from'prop-types';import{useNavigation}from'@shopgate/engage/core/hooks';import{HtmlSanitizer}from'@shopgate/engage/components';/**
* Renders a single properties row with HTML content.
* @param {Object} props The component props.
* @return {JSX.Element}
*/var ListsHTML=function ListsHTML(_ref){var properties=_ref.properties;var _useNavigation=useNavigation(),push=_useNavigation.push;var handleClick=useCallback(function(pathname,target){push(_extends({pathname:pathname},target&&{state:{target:target}}));},[push]);return properties.map(function(_ref2){var label=_ref2.label,value=_ref2.value,type=_ref2.type;return React.createElement("div",{key:label,className:"engage__product__product-property","data-type":type,"data-label":label},React.createElement(HtmlSanitizer,{settings:{handleClick:handleClick,html:value}},value));});};export default React.memo(ListsHTML);