@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
31 lines (30 loc) • 1.36 kB
JavaScript
const _excluded = ["tags"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
/**
* GenTeaserTags module.
* @module @massds/mayflower-react/GenTeaserTags
* @requires module:@massds/mayflower-assets/scss/03-organisms/gen-teaser
*/
import React from "react";
import PropTypes from "prop-types";
/**
* Tags
*/
const GenTeaserTags = props => {
const tags = props.tags,
rest = _objectWithoutPropertiesLoose(props, _excluded);
return /*#__PURE__*/React.createElement("div", _extends({
className: "ma__gen-teaser__tags"
}, rest),
// eslint-disable-next-line react/no-array-index-key
tags.map((tag, index) => /*#__PURE__*/React.createElement("span", {
key: tag + "--" + index,
className: "ma__gen-teaser__tag"
}, tag)));
};
GenTeaserTags.propTypes = process.env.NODE_ENV !== "production" ? {
/** An array of tags */
tags: PropTypes.arrayOf(PropTypes.string).isRequired
} : {};
export default GenTeaserTags;