import "@styles/Viewer.scss"; import { IChannel, IClient } from "react-ts5-remote-app-api"; export default function Viewer({ clients, channel, showChannelName = false, hideNonTalking = false, clientLimit = 0, }: { clients: IClient[] | undefined; channel: IChannel | undefined; showChannelName?: boolean; hideNonTalking?: boolean; clientLimit?: number; }) { return (
{showChannelName ? (

{channel?.properties.name}

) : null} {clients?.map((client, i) => { //* Client limit if (clientLimit != 0 && i >= clientLimit) { return null; } if (client) { //* Non-talking client if ( hideNonTalking && (client.properties.inputMuted || client.properties.outputMuted || client.talkStatus == 0) ) { return null; } //* Normal client return (
{client.properties.outputHardware == false ? ( muted_hardware_output ) : client.properties.inputHardware == false ? ( muted_hardware_input ) : client.properties.outputMuted ? ( muted_output ) : client.properties.inputMuted ? ( muted_input ) : client.talkStatus == 1 ? ( player_on_v2 ) : ( player_off_v2 )}

{client.properties.nickname}

); } else { return
; } })}
); }