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

import { renderTNodeJSX } from '../utils/render-tnode.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../utils/mixins.js';
import { Button } from '../button/index.js';
import props from './props.js';
import '@babel/runtime/helpers/defineProperty';
import '@babel/runtime/helpers/typeof';
import 'vue';
import '@vue/composition-api';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import 'lodash/merge';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../_chunks/dep-be599ec8.js';
import 'dayjs';
import '../_chunks/dep-67ff4010.js';
import '../config-provider/type.js';
import '../utils/withInstall.js';
import 'lodash/capitalize';
import '../button/button.js';
import '../loading/index.js';
import '../loading/directive.js';
import 'lodash/isObject';
import 'lodash/mapKeys';
import 'lodash/isEqual';
import '../loading/plugin.js';
import '../config.js';
import '../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../utils/easing.js';
import '../loading/loading.js';
import '../utils/transfer-dom.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../_common/js/loading/circle-adapter.js';
import '../_common/js/utils/set-style.js';
import '../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/isNull';
import 'lodash/isUndefined';
import 'lodash/isNumber';
import 'lodash/isArray';
import '../loading/style';
import '../loading/type.js';
import '../utils/ripple.js';
import '../button/props.js';
import '../button/style';
import '../button/type.js';

var classPrefixMixins = getClassPrefixMixins("comment");
var _Comment = mixins(classPrefixMixins).extend({
  name: "TComment",
  props: props,
  methods: {
    renderReply: function renderReply() {
      var h = this.$createElement;
      var reply = renderTNodeJSX(this, "reply");
      return reply ? h("div", {
        "class": "".concat(this.componentName, "__reply")
      }, [reply]) : null;
    },
    renderActions: function renderActions() {
      var h = this.$createElement;
      var actions = renderTNodeJSX(this, "actions");
      return actions && actions.length ? h("div", {
        "class": "".concat(this.componentName, "__actions")
      }, [actions.map(function (action, index) {
        return h(Button, {
          "key": "action-".concat(index),
          "attrs": {
            "size": "small",
            "variant": "text"
          }
        }, [action]);
      })]) : null;
    },
    renderQuote: function renderQuote() {
      var h = this.$createElement;
      var quote = renderTNodeJSX(this, "quote");
      return quote ? h("div", {
        "class": "".concat(this.componentName, "__quote")
      }, [quote]) : null;
    },
    renderAuthorDatetime: function renderAuthorDatetime() {
      var h = this.$createElement;
      var author = renderTNodeJSX(this, "author");
      var datetime = renderTNodeJSX(this, "datetime");
      return (author || datetime) && h("div", {
        "class": "".concat(this.componentName, "__author")
      }, [author && h("span", {
        "class": "".concat(this.componentName, "__name")
      }, [author]), datetime && h("span", {
        "class": "".concat(this.componentName, "__time")
      }, [datetime])]);
    },
    renderContent: function renderContent() {
      var h = this.$createElement;
      return h("div", {
        "class": "".concat(this.componentName, "__content")
      }, [this.renderAuthorDatetime(), h("div", {
        "class": "".concat(this.componentName, "__detail")
      }, [renderTNodeJSX(this, "content")]), this.renderQuote(), this.renderActions()]);
    },
    renderAvatar: function renderAvatar() {
      var h = this.$createElement;
      var avatar = renderTNodeJSX(this, "avatar");
      return avatar ? h("div", {
        "class": "".concat(this.componentName, "__avatar")
      }, [typeof avatar === "string" ? h("img", {
        "attrs": {
          "src": avatar,
          "alt": ""
        },
        "class": "".concat(this.componentName, "__avatar-image")
      }) : avatar]) : null;
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": this.componentName
    }, [h("div", {
      "class": "".concat(this.componentName, "__inner")
    }, [this.renderAvatar(), this.renderContent()]), this.renderReply()]);
  }
});

export { _Comment as default };
//# sourceMappingURL=comment.js.map
