mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-11-01 14:12:33 +01:00
better generator
This commit is contained in:
20
src/App.tsx
20
src/App.tsx
@@ -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}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user