/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

import props from './props.js';
import { renderLNodeJSX } from '../../utils/render-node.js';
import { getClassPrefixMixins } from '../config-provider/config-receiver.js';
import mixins from '../../utils/mixins.js';
import '@babel/runtime/helpers/defineProperty';
import '@babel/runtime/helpers/typeof';
import 'vue';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../_chunks/dep-a0f2090c.js';

var classPrefixMixins = getClassPrefixMixins("comment");
var _Comment = mixins(classPrefixMixins).extend({
  name: "LComment",
  props: props,
  methods: {
    renderReply: function renderReply() {
      var h = this.$createElement;
      var reply = renderLNodeJSX(this, "reply");
      return reply ? h("div", {
        "class": "".concat(this.componentName, "__reply")
      }, [reply]) : null;
    },
    renderActions: function renderActions() {
      var h = this.$createElement;
      var actions = renderLNodeJSX(this, "actions");
      return actions && actions.length ? h("ul", {
        "class": "".concat(this.componentName, "__actions")
      }, [actions.map(function (action, index) {
        return h("li", {
          "key": "action-".concat(index)
        }, [action]);
      })]) : null;
    },
    renderQuote: function renderQuote() {
      var h = this.$createElement;
      var quote = renderLNodeJSX(this, "quote");
      return quote ? h("div", {
        "class": "".concat(this.componentName, "__quote")
      }, [quote]) : null;
    },
    renderAuthorDatetime: function renderAuthorDatetime() {
      var h = this.$createElement;
      var author = renderLNodeJSX(this, "author");
      var datetime = renderLNodeJSX(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")
      }, [renderLNodeJSX(this, "content")]), this.renderQuote(), this.renderActions()]);
    },
    renderAvatar: function renderAvatar() {
      var h = this.$createElement;
      var avatar = renderLNodeJSX(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
