"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = FormattedDuration;

var _react = _interopRequireDefault(require("react"));

var _momentTimezone = _interopRequireDefault(require("moment-timezone"));

var _reactIntl = require("react-intl");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Formats the given duration according to the selected locale.
 */
function FormattedDuration({
  duration
}) {
  const dur = _momentTimezone.default.duration(duration, 'seconds');

  const hours = dur.hours();
  const minutes = dur.minutes();
  return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
    id: "common.time.tripDurationFormat",
    values: {
      hours,
      minutes
    }
  });
}

module.exports = exports.default;

//# sourceMappingURL=formatted-duration.js