"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireWildcard(require("react"));
require("./index.less");
var _antd = require("antd");
var _Summary = _interopRequireDefault(require("./Summary"));
var _MonthTrend = _interopRequireDefault(require("./MonthTrend"));
var _OrderRecord = _interopRequireDefault(require("./OrderRecord"));
var _api = require("../../api");
var _index2 = require("../../index");
var _lodash = _interopRequireDefault(require("lodash"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var OrderInfo = function OrderInfo() {
  var _useContext = (0, _react.useContext)(_index2.CcCpContext),
    id = _useContext.id;
  var restaurantList = _api.BasicService.useRestaurantList({
    id: id
  });
  var restaurantIds = _lodash["default"].map(restaurantList, 'id').join(',');
  var restaurantNames = _lodash["default"].map(restaurantList, 'name');
  var restaurantCodes = _lodash["default"].map(restaurantList, 'code');
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "cc-cp-order"
  }, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
    gutter: [10, 10]
  }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    xxl: 10,
    xl: 11,
    lg: 12,
    md: 24
  }, /*#__PURE__*/_react["default"].createElement(_Summary["default"], {
    restaurantIds: restaurantIds
  })), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    xxl: 14,
    xl: 13,
    lg: 12,
    md: 24
  }, /*#__PURE__*/_react["default"].createElement(_MonthTrend["default"], {
    restaurantIds: restaurantIds
  })), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_OrderRecord["default"], {
    restaurantNames: restaurantNames,
    restaurantCodes: restaurantCodes
  }))));
};
var _default = exports["default"] = OrderInfo;
//# sourceMappingURL=index.js.map
