@shopgate/engage
Version:
Shopgate's ENGAGE library.
45 lines (44 loc) • 1.06 kB
JavaScript
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}
*/
import { jsx as _jsx } from "react/jsx-runtime";
const ListsHTML = ({
properties
}) => {
const {
push
} = useNavigation();
const handleClick = useCallback((pathname, target) => {
push({
pathname,
...(target && {
state: {
target
}
})
});
}, [push]);
return properties.map(({
label,
value,
type
}) => /*#__PURE__*/_jsx("div", {
className: "engage__product__product-property",
"data-type": type,
"data-label": label,
children: /*#__PURE__*/_jsx(HtmlSanitizer, {
settings: {
handleClick,
html: value
},
children: value
})
}, label));
};
export default /*#__PURE__*/React.memo(ListsHTML);