22 lines
736 B
TypeScript
22 lines
736 B
TypeScript
// Metro module 15107 (f15108).
|
|
import useChannelVideoLimit from "../../video_calls/useChannelVideoLimit";
|
|
import VoiceChannelUserLimit from "./VoiceChannelUserLimit";
|
|
export function ConnectedUserLimit(props) {
|
|
const channel = props.channel;
|
|
let video = props.video;
|
|
const userCount = props.userCount;
|
|
const limit = useChannelVideoLimit(channel).limit;
|
|
const r13 = channel.userLimit > 0 ? channel.userLimit : -1;
|
|
if (video) {
|
|
video = limit > 0;
|
|
}
|
|
let videoLimit = false;
|
|
let total = r13;
|
|
if (video) {
|
|
const r1 = r13 < 0 || limit < r13;
|
|
total = r13 > 0 ? Math.min(r13, limit) : limit;
|
|
videoLimit = r1;
|
|
}
|
|
return <VoiceChannelUserLimit users={userCount} total={total} videoLimit={videoLimit} />;
|
|
}
|