/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 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 'vue';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../_chunks/dep-b1584b65.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) {
        console.warn("`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
