UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

33 lines (27 loc) 1.47 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * 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, ["date", "children"]); 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;