[feature] show proper viewer

This commit is contained in:
Janis
2023-06-25 21:48:14 +02:00
parent ff3cd783d5
commit cf7d0301d2
5 changed files with 89 additions and 50 deletions

View File

@@ -50,7 +50,6 @@ export default function App() {
return (
<div className="App">
{activeConnectionId}
<Viewer
clients={
clients.map((client) => {
@@ -61,46 +60,6 @@ export default function App() {
}
channel={currentChannel}
/>
<div className="list">
<h1>Channels {channels.length}</h1>
{channels.map((channel) => (
<div key={`${channel.id}-${channel.connection?.id}`}>
<p>
<b>
{channel.id} {channel.properties.name}
</b>
</p>
<hr />
{clients.map((client) => {
if (client.channel?.id === channel.id) {
return (
<p key={`${client.id}-${client.channel?.connection.id}`}>
{client.id} {client.properties.nickname}
</p>
);
}
})}
</div>
))}
</div>
<div className="list">
<h1>Clients {clients.length}</h1>
{clients.map((client) => (
<div key={`${client.id}-${client.channel?.connection.id}`}>
<p>
{client.id} {client.properties.nickname}
</p>
</div>
))}
</div>
<div className="list">
<h1>Connections {connections.length}</h1>
{connections.map((connection) => (
<div key={connection.id}>
<p>{connection.id}</p>
</div>
))}
</div>
</div>
);
}