chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
33 lines (31 loc) • 1.38 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = exports.HINT_POSITIONS = void 0;
var _clsx = _interopRequireDefault(require("clsx"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
const DEFAULT_HINT_TEXT = 'Einige der Öffnungszeiten überschneiden sich oder sind nicht in der richtigen Reihenfolge.';
const HINT_POSITIONS = {
NONE: 0,
TOP: 1,
BOTTOM: 2
};
exports.HINT_POSITIONS = HINT_POSITIONS;
const OpeningTimesHint = _ref => {
let {
content = '',
position
} = _ref;
return /*#__PURE__*/_react.default.createElement("div", {
className: (0, _clsx.default)('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.default.string,
position: _propTypes.default.oneOf([HINT_POSITIONS.NONE, HINT_POSITIONS.TOP, HINT_POSITIONS.BOTTOM]).isRequired
};
OpeningTimesHint.displayName = 'OpeningTimesHint';
var _default = /*#__PURE__*/_react.default.memo(OpeningTimesHint);
exports.default = _default;
//# sourceMappingURL=OpeningTimesHint.js.map