"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Countdown = void 0;
var _ui = require("@mirai/ui");
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var style = _interopRequireWildcard(require("./Countdown.module.css"));
var _shared__ = require("../../../../../__shared__");
var _helpers = require("../../../../../helpers");
var _Item = require("../../Item.l10n");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Countdown = _ref => {
  let {
    offer,
    timestamp
  } = _ref;
  const {
    isMobile
  } = (0, _ui.useDevice)();
  return timestamp ? /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true,
    className: [style.row, style.centered]
  }, /*#__PURE__*/_react.default.createElement(_ui.Icon, {
    action: isMobile,
    error: true,
    value: _helpers.ICON.ALARM
  }), /*#__PURE__*/_react.default.createElement(_shared__.Countdown, {
    error: true,
    l10n: !offer ? _Item.L10N.LABEL_COUNTDOWN : _Item.L10N.LABEL_COUNTDOWN_OFFER,
    small: true,
    timestamp: timestamp
  })) : null;
};
exports.Countdown = Countdown;
Countdown.displayName = 'Mirai:Core:Rates:Item.RateDetails:Countdown';
Countdown.propTypes = {
  offer: _propTypes.default.bool,
  timestamp: _propTypes.default.number
};
//# sourceMappingURL=Countdown.js.map