'use strict';

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var neetoAtoms = require('@bigbinary/neeto-atoms');
var neetoCist = require('@bigbinary/neeto-cist');
var useTimer = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useTimer');
var datetime = require('@bigbinary/neeto-commons-frontend/v2/utils/datetime');
var ramda = require('ramda');
var jsxRuntime = require('react/jsx-runtime');

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var DateFormat = ramda.fromPairs(ramda.keys(datetime.timeFormat).map(function (key) {
  return [neetoCist.capitalize(key), function (_ref) {
    var date = _ref.date,
      _ref$timerInterval = _ref.timerInterval,
      timerInterval = _ref$timerInterval === void 0 ? 60 : _ref$timerInterval,
      _ref$tooltipProps = _ref.tooltipProps,
      tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
      _ref$typographyProps = _ref.typographyProps,
      typographyProps = _ref$typographyProps === void 0 ? {} : _ref$typographyProps,
      _ref$tooltipDateForma = _ref.tooltipDateFormat,
      tooltipDateFormat = _ref$tooltipDateForma === void 0 ? "extended" : _ref$tooltipDateForma;
    useTimer(timerInterval);
    return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Tooltip, _objectSpread(_objectSpread({
      interactive: true,
      content: datetime.timeFormat[tooltipDateFormat](date),
      disabled: key === tooltipDateFormat,
      position: "top"
    }, tooltipProps), {}, {
      children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, _objectSpread(_objectSpread({
        as: "span",
        variant: "body3"
      }, typographyProps), {}, {
        children: datetime.timeFormat[key](date)
      }))
    }));
  }];
}));

module.exports = DateFormat;
//# sourceMappingURL=DateFormat.js.map
