"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

var _create = _interopRequireDefault(require("../utils/create"));

var _unit = require("../utils/format/unit");

var _Network = _interopRequireDefault(require("./Network"));

var PRESETS = ["error", "search", "default"];

var _default = (0, _create.default)({
  render: function render() {
    var _vm = this;

    var _h = _vm.$createElement;

    var _c = _vm._self._c || _h;

    return _c('div', {
      class: _vm.b()
    }, [_c('div', {
      class: _vm.b('image'),
      style: _vm.imageStyle
    }, [_vm._t("image", [_vm.image === 'network' ? _c('Network') : _c('img', {
      attrs: {
        "src": _vm.newImage
      }
    })])], 2), _vm._t("description", [_vm.description ? _c('p', {
      class: _vm.b('description')
    }, [_vm._v("\n      " + _vm._s(_vm.description) + "\n    ")]) : _vm._e()]), _c('div', {
      class: _vm.b('bottom')
    }, [_vm._t("default")], 2)], 2);
  },
  components: {
    Network: _Network.default
  },
  name: "empty",
  props: {
    imageSize: [Number, String],
    description: String,
    image: {
      type: String,
      default: "default"
    }
  },
  computed: {
    imageStyle: function imageStyle() {
      return {
        width: (0, _unit.addUnit)(this.imageSize),
        height: (0, _unit.addUnit)(this.imageSize)
      };
    },
    newImage: function newImage() {
      var image = this.image;

      if (PRESETS.indexOf(image) !== -1) {
        image = "https://wuner.gitee.io/static-resources/varied-mobile/static/empty-image-" + image + ".png";
      }

      return image;
    }
  }
});

exports.default = _default;