/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import { renderLNodeJSX } from '../../utils/render-node.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 'vue';
import 'lodash';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import 'lodash/merge';
import '../../_chunks/dep-b4fd1955.js';
import '../../utils/withInstall.js';
import 'lodash/capitalize';
import '../../config.js';
import '../button/button.js';
import '@ldesign/icons-vue';
import '../loading/index.js';
import '../loading/loading.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../_chunks/dep-eaa95999.js';
import '../../_chunks/dep-102361be.js';
import '../../utils/easing.js';
import '../../utils/transfer-dom.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../../_chunks/dep-aacc31a3.js';
import '../../_chunks/dep-c68dc4b6.js';
import '../../_chunks/dep-1a6bca30.js';
import '../loading/plugin.js';
import '../../utils/ripple.js';
import '../button/props.js';

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

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