UNPKG

@shopgate/engage

Version:
31 lines (30 loc) 660 B
import React from 'react'; import PropTypes from 'prop-types'; import Row from "./Row"; import RowHTML from "./RowHTML"; /** * Renders rows of product properties. * @param {Object} props The component props. * @returns {JSX.Element} */ import { jsx as _jsx } from "react/jsx-runtime"; const Rows = ({ properties }) => properties.map(({ value, label, type }) => { if (type === 'html') { return /*#__PURE__*/_jsx(RowHTML, { value: value, label: label }, label); } return /*#__PURE__*/_jsx(Row, { label: label, value: value, type: type }, `${label}-${value}`); }); export default /*#__PURE__*/React.memo(Rows);