UNPKG

@shopgate/engage

Version:
5 lines 1.14 kB
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 RowHTML=function RowHTML(_ref){var value=_ref.value,label=_ref.label;var _useNavigation=useNavigation(),push=_useNavigation.push;var handleClick=useCallback(function(pathname,target){push(_extends({pathname:pathname},target&&{state:{target:target}}));},[push]);return React.createElement("tr",{className:"engage__product__product-property","data-type":"html","data-label":label},React.createElement("td",{colSpan:2},React.createElement(HtmlSanitizer,{settings:{handleClick:handleClick,html:value}},value)));};export default React.memo(RowHTML);