better generator

This commit is contained in:
Janis
2023-11-12 16:28:42 +01:00
parent bbd10af0dc
commit 5ef2facfec
9 changed files with 182 additions and 132 deletions

View File

@@ -1,22 +1,11 @@
import "@styles/App.scss";
import { Navigate, Route, Routes, useSearchParams } from "react-router-dom";
import useTSRemoteApp, { IClient } from "react-ts5-remote-app-api";
import Viewer from "./Viewer";
import Generator from "./Generator";
export default function App() {
const [searchParams] = useSearchParams();
const { clients, activeConnectionId, currentChannel } = useTSRemoteApp({
remoteAppPort: parseInt(searchParams.get("remoteAppPort") ?? "5899"),
auth: {
identifier: "de.tealfire.obs",
version: "2.0.0",
name: "TS5 OBS Overlay",
description: "A OBS overlay for TS5 by DerTyp7",
},
logging: true,
});
return (
<Routes>
@@ -24,17 +13,10 @@ export default function App() {
path="/"
element={
<Viewer
remoteAppPort={parseInt(searchParams.get("remoteAppPort") ?? "5899")}
showChannelName={searchParams.get("showChannelName") === "true"}
hideNonTalking={searchParams.get("hideNonTalking") === "true"}
clientLimit={searchParams.get("clientLimit") ? parseInt(searchParams.get("clientLimit") ?? "0") : 0}
clients={
clients.map((client) => {
if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) {
return client;
}
}) as IClient[]
}
channel={currentChannel}
/>
}
/>