import { defineComponent, ref, watchEffect, openBlock, createElementBlock, unref, toDisplayString, createElementVNode, createCommentVNode } from "vue";
import "../../../../adapter-vue.mjs";
import { TUITranslateService } from "@tencentcloud/chat-uikit-engine";
const _hoisted_1 = { class: "revoke" };
const _hoisted_2 = { key: 0 };
const _hoisted_3 = { key: 1 };
const _hoisted_4 = { key: 2 };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "message-revoked",
  props: {
    isEdit: {
      type: Boolean,
      default: () => false
    },
    messageItem: {
      type: Object,
      default: () => ({})
    }
  },
  emits: ["messageEdit"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const message = ref();
    const isEditMsg = ref(false);
    const emits = __emit;
    watchEffect(() => {
      message.value = props.messageItem;
      isEditMsg.value = props.isEdit;
    });
    const messageEdit = () => {
      emits("messageEdit");
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        unref(message).flow === "in" ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(message).nick || unref(message).from), 1)) : unref(message).from === unref(message).revoker ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(TUITranslateService).t("TUIChat.您")), 1)) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(message).revoker), 1)),
        createElementVNode("span", null, toDisplayString(unref(TUITranslateService).t("TUIChat.撤回了一条消息")), 1),
        unref(message).flow === "out" && unref(isEditMsg) ? (openBlock(), createElementBlock("span", {
          key: 3,
          class: "edit",
          onClick: messageEdit
        }, toDisplayString(unref(TUITranslateService).t("TUIChat.重新编辑")), 1)) : createCommentVNode("", true)
      ]);
    };
  }
});
export {
  _sfc_main as default
};
