@tencentcloud/roomkit-web-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,
65 lines (64 loc) • 2.52 kB
JavaScript
import { defineComponent, createElementBlock, openBlock, createVNode, withDirectives, unref, withCtx, vShow } from "vue";
import { storeToRefs } from "pinia";
import IconButton from "../common/base/IconButton.vue.mjs";
import { TUIBadge, IconStageApplication } from "@tencentcloud/uikit-base-component-vue3";
import { useBasicStore } from "../../stores/basic.mjs";
import { useRoomStore } from "../../stores/room.mjs";
import { useI18n } from "../../locales/index.mjs";
import { isMobile } from "../../utils/environment.mjs";
import MasterApplyControl from "./ApplyControl/MasterApplyControl/index.mjs";
import useMasterApplyControl from "../../hooks/useMasterApplyControl.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ManageStageControl",
setup(__props) {
const { t } = useI18n();
const basicStore = useBasicStore();
const roomStore = useRoomStore();
const { handleShowNotification } = useMasterApplyControl();
const { sidebarName, showApplyUserList } = storeToRefs(basicStore);
const { applyToAnchorList } = storeToRefs(roomStore);
function toggleManageStage() {
if (!isMobile) {
basicStore.setShowApplyUserList(!showApplyUserList.value);
} else {
if (basicStore.isSidebarOpen && basicStore.sidebarName === "apply") {
basicStore.setSidebarOpenStatus(false);
basicStore.setSidebarName("");
return;
}
basicStore.setSidebarOpenStatus(true);
basicStore.setSidebarName("apply");
}
}
handleShowNotification();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
createVNode(unref(TUIBadge), {
hidden: unref(applyToAnchorList).length === 0,
value: unref(applyToAnchorList).length,
max: 10
}, {
default: withCtx(() => [
createVNode(IconButton, {
title: unref(t)("Apply to stage"),
"is-active": unref(sidebarName) === "apply",
onClickIcon: toggleManageStage
}, {
default: withCtx(() => [
createVNode(unref(IconStageApplication), { size: "24" })
]),
_: 1
}, 8, ["title", "is-active"])
]),
_: 1
}, 8, ["hidden", "value"]),
withDirectives(createVNode(unref(MasterApplyControl), null, null, 512), [
[vShow, unref(showApplyUserList)]
])
]);
};
}
});
export {
_sfc_main as default
};