/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

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

var log = require('../../chunks/log.js');
var utils_renderNode = require('../../utils/render-node.js');
var components_configProvider_configReceiver = require('../config-provider/config-receiver.js');
var utils_mixins = require('../../utils/mixins.js');
var components_list_props = require('./props.js');
require('../../chunks/_commonjsHelpers-2e6815bd.js');
require('vue');
require('lodash');
require('lodash/mergeWith');
require('../config-provider/context.js');
require('../../chunks/zh_CN.js');

const classPrefixMixins = components_configProvider_configReceiver.getClassPrefixMixins("list-item__meta");
var _ListItemMeta = utils_mixins["default"](classPrefixMixins).extend({
  name: "LListItemMeta",
  props: components_list_props.ListItemMetaProps,
  methods: {
    renderAvatar() {
      const h = this.$createElement;
      if (this.avatar || this.$scopedSlots.avatar) log.log.warn("ListItemMeta", "`avatar` is going to be deprecated, please use `image` instead");
      const thumbnail = utils_renderNode.renderContent(this, "avatar", "image");
      if (!thumbnail) return;
      if (typeof thumbnail === "string") {
        return h("div", {
          "class": `${this.componentName}-avatar`
        }, [h("img", {
          "attrs": {
            "src": thumbnail
          }
        })]);
      }
      return h("div", {
        "class": `${this.componentName}-avatar`
      }, [thumbnail]);
    }
  },
  render() {
    const h = arguments[0];
    const propsTitleContent = utils_renderNode.renderLNodeJSX(this, "title");
    const propsDescriptionContent = utils_renderNode.renderLNodeJSX(this, "description");
    const listItemMetaContent = [this.renderAvatar(), h("div", {
      "class": `${this.componentName}-content`
    }, [propsTitleContent && h("h3", {
      "class": `${this.componentName}-title`
    }, [propsTitleContent]), propsDescriptionContent && h("p", {
      "class": `${this.componentName}-description`
    }, [propsDescriptionContent])])];
    return h("div", {
      "class": this.componentName
    }, [listItemMetaContent]);
  }
});

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