"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"));
var _index = require("../../index");
var _antd = require("antd");
var _vmCard = _interopRequireDefault(require("../../../vm-card"));
var _Info = _interopRequireDefault(require("../QdBasic/Info"));
var _config = require("../../config");
var _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
var _qrcode = require("qrcode.react");
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 QdDetailInfo = function QdDetailInfo() {
  var _useContext = (0, _react.useContext)(_index.RestaurantContext),
    info = _useContext.info;
  var dataSource = _config.QD_DETAIL_FIELDS.map(function (item) {
    return Object.assign(Object.assign({}, item), {
      value: info === null || info === void 0 ? void 0 : info[item.key],
      render: item.key === 'qrcode' ? function () {
        return /*#__PURE__*/_react["default"].createElement(_qrcode.QRCodeSVG, {
          value: info.id
        });
      } : undefined
    });
  });
  return /*#__PURE__*/_react["default"].createElement(_antd.Row, {
    gutter: [10, 10],
    style: {
      padding: 10
    }
  }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], {
    title: "\u57FA\u672C\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
    width: "33%"
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], {
    title: "\u8BE6\u60C5\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: dataSource,
    horizontal: true,
    width: '33%',
    ellipsis: true
  }))));
};
var _default = exports["default"] = QdDetailInfo;
//# sourceMappingURL=index.js.map
