[feature] add basic viewer

This commit is contained in:
Janis
2023-06-25 19:39:58 +02:00
parent c0f27e85c1
commit 40dbf72fcf
4 changed files with 108 additions and 14 deletions

29
src/Viewer.tsx Normal file
View File

@@ -0,0 +1,29 @@
import { IChannel, IClient } from "interfaces/teamspeak";
export default function Viewer({
clients,
channel,
}: {
clients: IClient[] | undefined;
channel: IChannel | undefined;
}) {
return (
<div>
<h1>{channel?.properties.name}</h1>
{clients?.map((client) => {
if (client) {
return (
<p key={`${client.id}-${client.channel?.connection.id}`}>
{client.talkStatus === 1 ? "🎤" : ""}
{client.properties.inputMuted ? "🎤x" : ""}
{client.properties.outputMuted ? "🔈" : ""}
{client.id} {client.properties.nickname}
</p>
);
} else {
return <></>;
}
})}
</div>
);
}