@tencentcloud/roomkit-electron-vue3
Version:
<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,
74 lines (73 loc) • 2.75 kB
JavaScript
import { defineComponent, ref, withDirectives, createCommentVNode, unref, createElementBlock, openBlock, createVNode, createBlock } from "vue";
import IconButton from "../common/base/IconButton.vue.mjs";
import InviteIcon from "../common/icons/InviteIcon.vue.mjs";
import { useBasicStore } from "../../stores/basic.mjs";
import { storeToRefs } from "pinia";
import { useI18n } from "../../locales/index.mjs";
import "../../services/main.mjs";
import { roomService } from "../../services/roomService.mjs";
import "@tencentcloud/tuiroom-engine-electron";
import { isMobile } from "../../utils/environment.mjs";
import "mitt";
import "../../services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
import RoomInviteOverlay from "../RoomInvite/index.vue.mjs";
import vClickOutside from "../../directives/vClickOutside.mjs";
const _hoisted_1 = {
key: 0,
class: "invite-control-container"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "InviteControl",
emits: ["show-overlay"],
setup(__props, { emit: __emit }) {
const isShowInviteTab = ref(false);
const inviteRef = ref();
const basicStore = useBasicStore();
const { sidebarName } = storeToRefs(basicStore);
const { t } = useI18n();
const emit = __emit;
const inviteControlConfig = roomService.getComponentConfig("InviteControl");
function toggleInviteSidebar() {
isShowInviteTab.value = !isShowInviteTab.value;
if (isMobile) {
if (basicStore.sidebarName === "invite") {
basicStore.setSidebarName("");
return;
}
basicStore.setSidebarName("invite");
emit("show-overlay", {
name: "RoomInviteOverlay",
visible: isShowInviteTab.value
});
}
roomService.trackingManager.sendMessage("experience-invite");
}
function handleClickOutSide() {
if (isShowInviteTab.value) {
isShowInviteTab.value = false;
}
}
return (_ctx, _cache) => {
return unref(inviteControlConfig).visible ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
createVNode(IconButton, {
class: "invite",
"is-active": unref(sidebarName) === "invite",
title: unref(t)("Invite"),
icon: InviteIcon,
onClickIcon: toggleInviteSidebar
}, null, 8, ["is-active", "title"]),
!unref(isMobile) && isShowInviteTab.value ? (openBlock(), createBlock(RoomInviteOverlay, {
key: 0,
ref_key: "inviteRef",
ref: inviteRef
}, null, 512)) : createCommentVNode("", true)
])), [
[unref(vClickOutside), handleClickOutSide]
]) : createCommentVNode("", true);
};
}
});
export {
_sfc_main as default
};