import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, normalizeClass, renderSlot, createBlock, createElementVNode, unref, createTextVNode, toDisplayString, createVNode } from "vue";
import { TUIIcon, IconArrowUp } from "@tencentcloud/uikit-base-component-vue3";
const _hoisted_1 = { class: "icon-button-container" };
const _hoisted_3 = { class: "title" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "IconButton",
  props: {
    title: { default: "" },
    hasMore: { type: Boolean, default: false },
    hideHoverEffect: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    isActive: { type: Boolean, default: false },
    layout: {
      default: "vertical"
      /* VERTICAl */
    },
    icon: { default: null },
    isNotSupport: { type: Boolean, default: false },
    badgeCount: { default: 0 }
  },
  emits: ["click-icon", "click-more"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const iconContentClass = computed(() => {
      if (props.layout === "horizontal") {
        return "icon-content-horizontal";
      }
      return "icon-content-vertical";
    });
    const handleClickEvent = () => {
      emit("click-icon");
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(), createElementBlock("div", {
          key: 1,
          class: normalizeClass(["icon-content", iconContentClass.value, `${__props.disabled && "disabled"}`]),
          onClick: handleClickEvent
        }, [
          renderSlot(_ctx.$slots, "default", {}, void 0, true),
          __props.icon ? (openBlock(), createBlock(unref(TUIIcon), {
            key: 0,
            icon: __props.icon
          }, null, 8, ["icon"])) : createCommentVNode("", true),
          createElementVNode("span", _hoisted_3, [
            createTextVNode(toDisplayString(__props.title) + " ", 1),
            renderSlot(_ctx.$slots, "title", {}, void 0, true)
          ])
        ], 2)),
        __props.hasMore ? (openBlock(), createElementBlock("div", {
          key: 2,
          ref: "moreSpanRef",
          class: "icon-arrow",
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click-more"))
        }, [
          createVNode(unref(IconArrowUp), { size: "12" })
        ], 512)) : createCommentVNode("", true)
      ]);
    };
  }
});
export {
  _sfc_main as default
};
