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

import '../../chunks/index.js';
import { renderContent, renderLNodeJSX } from '../../utils/render-node.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import { ListItemMetaProps } from './props.js';
import { l as log } from '../../chunks/log.js';
import '../../chunks/_commonjsHelpers-2e6815bd.js';
import 'vue';
import 'lodash';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';

const classPrefixMixins = getClassPrefixMixins("list-item__meta");
var _ListItemMeta = mixins(classPrefixMixins).extend({
  name: "LListItemMeta",
  props: ListItemMetaProps,
  methods: {
    renderAvatar() {
      const h = this.$createElement;
      if (this.avatar || this.$scopedSlots.avatar) log.warn("ListItemMeta", "`avatar` is going to be deprecated, please use `image` instead");
      const thumbnail = 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 = renderLNodeJSX(this, "title");
    const propsDescriptionContent = 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]);
  }
});

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