"use strict";

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

var _coreUtils = _interopRequireDefault(require("@opentripplanner/core-utils"));

var _icons = require("@opentripplanner/icons");

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

var _itinerarySummary = _interopRequireDefault(require("../../narrative/default/itinerary-summary"));

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

const {
  formatDuration,
  formatTime
} = _coreUtils.default.time;

const TripSummary = ({
  monitoredTrip
}) => {
  const {
    itinerary
  } = monitoredTrip;
  const {
    duration,
    endTime,
    startTime
  } = itinerary; // TODO: use the modern itinerary summary built for trip comparison.

  return /*#__PURE__*/_react.default.createElement("div", {
    className: `otp option default-itin`,
    style: {
      borderTop: '0px',
      padding: '0px'
    }
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "header"
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: "title"
  }, "Itinerary"), ' ', /*#__PURE__*/_react.default.createElement("span", {
    className: "duration pull-right"
  }, formatDuration(duration)), ' ', /*#__PURE__*/_react.default.createElement("span", {
    className: "arrivalTime"
  }, formatTime(startTime), "\u2014", formatTime(endTime)), /*#__PURE__*/_react.default.createElement(_itinerarySummary.default, {
    itinerary: itinerary,
    LegIcon: _icons.ClassicLegIcon
  })));
};

var _default = TripSummary;
exports.default = _default;
module.exports = exports.default;

//# sourceMappingURL=trip-summary.js