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

import { defineComponent, createVNode } from 'vue';
import isString from 'lodash/isString';
import { usePrefixClass } from '../hooks/useConfig.js';
import { useContent, useTNodeJSX } from '../hooks/tnode.js';
import props from './list-item-meta-props.js';
import '../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import 'lodash/isFunction';
import '../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-e041f5b0.js';
import 'dayjs';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../utils/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isObject';

var _ListItemMeta = defineComponent({
  name: "TListItemMeta",
  props: props,
  setup: function setup(props2, ctx) {
    var COMPONENT_NAME = usePrefixClass("list-item__meta");
    var renderContent = useContent();
    var renderTNodeJSX = useTNodeJSX();
    var renderAvatar = function renderAvatar() {
      if (props2.avatar || ctx.slots.avatar) console.warn("`avatar` is going to be deprecated, please use `image` instead");
      var thumbnail = renderContent("avatar", "image");
      if (!thumbnail) return;
      if (isString(thumbnail)) {
        return createVNode("div", {
          "class": "".concat(COMPONENT_NAME.value, "-avatar")
        }, [createVNode("img", {
          "src": thumbnail
        }, null)]);
      }
      return createVNode("div", {
        "class": "".concat(COMPONENT_NAME.value, "-avatar")
      }, [thumbnail]);
    };
    return function () {
      var propsTitleContent = renderTNodeJSX("title");
      var propsDescriptionContent = renderTNodeJSX("description");
      var listItemMetaContent = [renderAvatar(), createVNode("div", {
        "class": "".concat(COMPONENT_NAME.value, "-content")
      }, [propsTitleContent && createVNode("h3", {
        "class": "".concat(COMPONENT_NAME.value, "-title")
      }, [propsTitleContent]), propsDescriptionContent && createVNode("p", {
        "class": "".concat(COMPONENT_NAME.value, "-description")
      }, [propsDescriptionContent])])];
      return createVNode("div", {
        "class": COMPONENT_NAME.value
      }, [listItemMetaContent]);
    };
  }
});

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