/**
 * tdesign v0.41.7
 * (c) 2022 tdesign
 * @license MIT
 */

import Vue from 'vue';
import { prefix } from '../config.js';
import props from './list-item-meta-props.js';
import { renderContent, renderTNodeJSX } from '../utils/render-tnode.js';
import '@babel/runtime/helpers/defineProperty';
import '@babel/runtime/helpers/typeof';

var name = "".concat(prefix, "-list-item__meta");
var _ListItemMeta = Vue.extend({
  name: "TListItemMeta",
  props: props,
  methods: {
    renderAvatar: function renderAvatar() {
      var h = this.$createElement;

      if (this.avatar || this.$scopedSlots.avatar) {
        console.warn("`avatar` is going to be deprecated, please use `image` instead");
      }

      var thumbnail = renderContent(this, "avatar", "image");
      if (!thumbnail) return;

      if (typeof thumbnail === "string") {
        return h("div", {
          "class": "".concat(name, "-avatar")
        }, [h("img", {
          "attrs": {
            "src": thumbnail
          }
        })]);
      }

      return h("div", {
        "class": "".concat(name, "-avatar")
      }, [thumbnail]);
    }
  },
  render: function render() {
    var h = arguments[0];
    var propsTitleContent = renderTNodeJSX(this, "title");
    var propsDescriptionContent = renderTNodeJSX(this, "description");
    var listItemMetaContent = [this.renderAvatar(), h("div", {
      "class": "".concat(name, "-content")
    }, [propsTitleContent && h("h3", {
      "class": "".concat(name, "-title")
    }, [propsTitleContent]), propsDescriptionContent && h("p", {
      "class": "".concat(name, "-description")
    }, [propsDescriptionContent])])];
    return h("div", {
      "class": name
    }, [listItemMetaContent]);
  }
});

export { _ListItemMeta as default };
//# sourceMappingURL=list-item-meta.js.map
