/**
 * ldesign v0.4.6
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var utils_renderTnode = require('../utils/render-tnode.js');
var configProvider_configReceiver = require('../config-provider/config-receiver.js');
var utils_mixins = require('../utils/mixins.js');
var list_listItemMetaProps = require('./list-item-meta-props.js');
require('@babel/runtime/helpers/defineProperty');
require('@babel/runtime/helpers/typeof');
require('vue');
require('@vue/composition-api');
require('lodash/camelCase');
require('lodash/kebabCase');
require('lodash/mergeWith');
require('../config-provider/context.js');
require('lodash/merge');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('../_chunks/dep-7c884501.js');
require('dayjs');

var classPrefixMixins = configProvider_configReceiver.getClassPrefixMixins("list-item__meta");
var _ListItemMeta = utils_mixins["default"](classPrefixMixins).extend({
  name: "TListItemMeta",
  props: list_listItemMetaProps["default"],
  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 = utils_renderTnode.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 = utils_renderTnode.renderTNodeJSX(this, "title");
    var propsDescriptionContent = utils_renderTnode.renderTNodeJSX(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]);
  }
});

exports["default"] = _ListItemMeta;
//# sourceMappingURL=list-item-meta.js.map
