/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

import { ListItemMetaProps } from './props.js';
import { renderContent, renderLNodeJSX } from '../../utils/render-node.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import '@babel/runtime/helpers/defineProperty';
import '@babel/runtime/helpers/typeof';
import 'vue';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';

var classPrefixMixins = getClassPrefixMixins("list-item__meta");
var _ListItemMeta = mixins(classPrefixMixins).extend({
  name: "LListItemMeta",
  props: ListItemMetaProps,
  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(this.componentName, "-avatar")
        }, [h("img", {
          "attrs": {
            "src": thumbnail
          }
        })]);
      }

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

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