UNPKG

@shopgate/engage

Version:
33 lines (32 loc) 786 B
import React from 'react'; import PropTypes from 'prop-types'; import { Ellipsis, ConditionalWrapper } from '@shopgate/engage/components'; /** * @param {Object} props The component props * @returns {JSX} */ import { jsx as _jsx } from "react/jsx-runtime"; const ProductNameContent = ({ name, ellipsis, rows }) => /*#__PURE__*/_jsx(ConditionalWrapper, { condition: ellipsis, wrapper: children => /*#__PURE__*/_jsx(Ellipsis, { rows: rows !== null ? rows : undefined, children: /*#__PURE__*/_jsx("span", { children: children }) }), children: /*#__PURE__*/_jsx("span", { dangerouslySetInnerHTML: { __html: name } }) }); ProductNameContent.defaultProps = { name: null, ellipsis: true, rows: null }; export default ProductNameContent;