@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
29 lines (28 loc) • 1.33 kB
JavaScript
const _excluded = ["date", "children"];
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; }
/**
* GenTeaserDate module.
* @module @massds/mayflower-react/GenTeaserDate
* @requires module:@massds/mayflower-assets/scss/03-organisms/gen-teaser
*/
import React from "react";
import PropTypes from "prop-types";
/**
* Date
*/
const GenTeaserDate = props => {
const date = props.date,
children = props.children,
rest = _objectWithoutPropertiesLoose(props, _excluded);
return /*#__PURE__*/React.createElement("span", _extends({
className: "ma__gen-teaser__date"
}, rest), children || date);
};
GenTeaserDate.propTypes = process.env.NODE_ENV !== "production" ? {
/** Either a formatted date or a formatted date with a label */
date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
/** React children to render */
children: PropTypes.node
} : {};
export default GenTeaserDate;