UNPKG

chayns-components

Version:

A set of beautiful React components for developing chayns® applications.

26 lines (25 loc) 1.01 kB
import classnames from 'clsx'; import PropTypes from 'prop-types'; import React from 'react'; const DEFAULT_HINT_TEXT = 'Einige der Öffnungszeiten überschneiden sich oder sind nicht in der richtigen Reihenfolge.'; export const HINT_POSITIONS = { NONE: 0, TOP: 1, BOTTOM: 2 }; const OpeningTimesHint = _ref => { let { content = '', position } = _ref; return /*#__PURE__*/React.createElement("div", { className: classnames('content__card content__card--warning cc__opening-times__hint', position === HINT_POSITIONS.TOP && 'cc__opening-times__hint--top', position === HINT_POSITIONS.BOTTOM && 'cc__opening-times__hint--bottom') }, content || DEFAULT_HINT_TEXT); }; OpeningTimesHint.propTypes = { content: PropTypes.string, position: PropTypes.oneOf([HINT_POSITIONS.NONE, HINT_POSITIONS.TOP, HINT_POSITIONS.BOTTOM]).isRequired }; OpeningTimesHint.displayName = 'OpeningTimesHint'; export default /*#__PURE__*/React.memo(OpeningTimesHint); //# sourceMappingURL=OpeningTimesHint.js.map