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,
69 lines (68 loc) • 2.46 kB
JavaScript
import { defineComponent, ref, watch, openBlock, createElementBlock, toDisplayString, unref, createCommentVNode, createBlock, withCtx, createTextVNode } from "vue";
import { TUIButton } from "@tencentcloud/uikit-base-component-vue3";
import { useI18n } from "../../../locales/index.mjs";
import "../../../services/main.mjs";
import { roomService } from "../../../services/roomService.mjs";
import { TUIInvitationStatus } from "@tencentcloud/tuiroom-engine-js";
import "../../../utils/environment.mjs";
import "mitt";
import "../../../services/manager/roomActionManager.mjs";
import "@tencentcloud/tui-core";
import renderMsg from "../../common/base/Message/Message.mjs";
import { MESSAGE_DURATION } from "../../../constants/message.mjs";
const _hoisted_1 = { class: "member-invite-container" };
const _hoisted_2 = {
key: 0,
class: "member-invite-reject"
};
const _hoisted_3 = {
key: 1,
class: "member-invite-calling"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "MemberInvite",
props: {
userInfo: {}
},
setup(__props) {
const { t } = useI18n();
const showReject = ref(false);
const handleInvite = () => {
roomService.conferenceInvitationManager.inviteUsers({
userIdList: [props.userInfo.userId]
});
renderMsg({
type: "success",
message: t("Invitation sent, waiting for members to join."),
duration: MESSAGE_DURATION.NORMAL
});
};
const props = __props;
watch(props.userInfo, (val) => {
if (val.status === TUIInvitationStatus.kRejected) {
showReject.value = true;
setTimeout(() => {
showReject.value = false;
}, 3e3);
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
showReject.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(t)("Not joining for now")), 1)) : createCommentVNode("", true),
_ctx.userInfo.status === unref(TUIInvitationStatus).kPending ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(t)("Calling...")), 1)) : (openBlock(), createBlock(unref(TUIButton), {
key: 2,
onClick: handleInvite,
type: "primary"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(t)("Call")), 1)
]),
_: 1
}))
]);
};
}
});
export {
_sfc_main as default
};