[feature] add hideNonTalking boolean

This commit is contained in:
Janis Meister
2023-06-30 13:05:24 +02:00
parent ba5930cadc
commit c1c9db8f95
2 changed files with 13 additions and 0 deletions

View File

@@ -5,16 +5,27 @@ export default function Viewer({
clients,
channel,
showChannelName = false,
hideNonTalking = false,
}: {
clients: IClient[] | undefined;
channel: IChannel | undefined;
showChannelName?: boolean;
hideNonTalking?: boolean;
}) {
return (
<div className="viewer">
{showChannelName ? <h3>{channel?.properties.name}</h3> : null}
{clients?.map((client) => {
if (client) {
//* Non-talking client
if (
hideNonTalking &&
(client.properties.inputMuted || client.properties.outputMuted || client.talkStatus == 0)
) {
return null;
}
//* Normal client
return (
<div className="client" key={`${client.id}-${client.channel?.connection.id}`}>
{client.properties.outputMuted ? (