"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _useSettings2 = _interopRequireDefault(require("../vm-hooks/useSettings"));
var _utils = require("@vtx/utils");
require("./style/index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var VmCustom = function VmCustom(_ref) {
  var id = _ref.id,
    url = _ref.url,
    key = _ref.key;
  var _useSettings = (0, _useSettings2["default"])(),
    theme = _useSettings.theme;
  var _getVtxToken = (0, _utils.getVtxToken)(),
    token = _getVtxToken.token,
    userId = _getVtxToken.userId,
    tenantId = _getVtxToken.tenantId;
  var param = (url === null || url === void 0 ? void 0 : url.indexOf('http')) > -1 ? "&userId=".concat(userId, "&tenantId=").concat(tenantId, "&token=").concat(token) : '';
  return /*#__PURE__*/_react["default"].createElement("iframe", {
    key: key,
    src: "".concat(url).concat(id, "&theme=").concat(theme).concat(param),
    style: {
      width: '100%',
      height: 600,
      border: 'none',
      overflowY: 'auto'
    }
  });
};
var _default = exports["default"] = VmCustom;
//# sourceMappingURL=index.js.map
