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); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import classnames from 'classnames';
import useSettings from "../../_hooks/useSettings";
import no_chart from "./assets/no_chart.png";
import no_data from "./assets/no_data.png";
import no_data_2 from "./assets/no_data_2.png";
import no_news from "./assets/no_news.png";
import no_permission from "./assets/no_permission.png";
import no_picture from "./assets/no_picture.png";
import no_result from "./assets/no_result.png";
import no_video from "./assets/no_video.png";
import page_error from "./assets/page_error.png";
import "./style";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var CONFIG = {
  NO_CHART: {
    img: no_chart,
    text: '图表无数据'
  },
  NO_DATA: {
    img: no_data,
    text: '暂无数据'
  },
  NO_DATA_2: {
    img: no_data_2,
    text: '暂无数据'
  },
  NO_NEWS: {
    img: no_news,
    text: '暂无消息'
  },
  NO_PERMISSION: {
    img: no_permission,
    text: '无权限'
  },
  NO_PICTURE: {
    img: no_picture,
    text: '暂无图片'
  },
  NO_RESULT: {
    img: no_result,
    text: '搜索无结果'
  },
  PAGE_ERROR: {
    img: page_error,
    text: '页面错误'
  },
  NO_VIDEO: {
    img: no_video,
    text: '暂无视频'
  }
};
var prefix = 'vm-empty';
function VmEmpty(props) {
  var _useSettings = useSettings(),
    isDark = _useSettings.isDark;
  var _props$style = props.style,
    style = _props$style === void 0 ? {} : _props$style,
    _props$type = props.type,
    type = _props$type === void 0 ? 'NO_DATA' : _props$type,
    TEXT = props.text,
    _props$showText = props.showText,
    showText = _props$showText === void 0 ? true : _props$showText,
    className = props.className;
  var _ref = CONFIG[type] || {},
    img = _ref.img,
    text = _ref.text;
  return /*#__PURE__*/_jsxs("div", {
    className: classnames("".concat(prefix, " ").concat(isDark ? 'dark' : ''), className),
    style: _objectSpread({}, style),
    children: [/*#__PURE__*/_jsx("img", {
      className: classnames("".concat(prefix, "-img")),
      alt: TEXT || text,
      src: img
    }), showText && /*#__PURE__*/_jsx("div", {
      className: classnames("".concat(prefix, "-text")),
      children: TEXT || text
    })]
  });
}
export default VmEmpty;