{client.properties.nickname}
); diff --git a/src/assets/icons/input_hardware.svg b/src/assets/icons/input_hardware.svg new file mode 100644 index 0000000..fd4d004 --- /dev/null +++ b/src/assets/icons/input_hardware.svg @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/src/assets/icons/input_muted.svg b/src/assets/icons/input_muted.svg new file mode 100644 index 0000000..cf7e787 --- /dev/null +++ b/src/assets/icons/input_muted.svg @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/src/assets/icons/muted_hardware_output.svg b/src/assets/icons/muted_hardware_output.svg new file mode 100644 index 0000000..9e76f60 --- /dev/null +++ b/src/assets/icons/muted_hardware_output.svg @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/src/assets/icons/not_talk.svg b/src/assets/icons/not_talk.svg new file mode 100644 index 0000000..e5db837 --- /dev/null +++ b/src/assets/icons/not_talk.svg @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/src/assets/icons/output_muted.svg b/src/assets/icons/output_muted.svg new file mode 100644 index 0000000..6ccfa42 --- /dev/null +++ b/src/assets/icons/output_muted.svg @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/src/assets/icons/talk.svg b/src/assets/icons/talk.svg new file mode 100644 index 0000000..30ffbf2 --- /dev/null +++ b/src/assets/icons/talk.svg @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/src/components/TalkStatus.tsx b/src/components/TalkStatus.tsx new file mode 100644 index 0000000..65ca387 --- /dev/null +++ b/src/components/TalkStatus.tsx @@ -0,0 +1,47 @@ +import "@styles/TalkStatus.scss"; +import { IClient } from "react-teamspeak-remote-app-api"; +import MutedHardwareOutputSvg from "@assets/icons/muted_hardware_output.svg?react"; +import InputHardwareSvg from "@assets/icons/input_hardware.svg?react"; +import OutputMutedSvg from "@assets/icons/output_muted.svg?react"; +import InputMutedSvg from "@assets/icons/input_muted.svg?react"; +import TalkingSvg from "@assets/icons/talk.svg?react"; +import NotTalkingSvg from "@assets/icons/not_talk.svg?react"; + +// TODO outsource svg to files +export default function TalkStatus({ client, showTsAvatar }: { client: IClient; showTsAvatar: boolean }) { + function getTeamSpeakAvatarUrl(): string { + // MyTeamSpeak avatar property looks like this: + // 1,https://storage.googleapis.com/ts-sys-myts-avatars/d4864285-0b77-4f2d-b0c5-1ae585e66ee5/258947109;2,https://storage.googleapis.com/ts-sys-myts-avatars/d4864285-0b77-4f2d-b0c5-1ae585e66ee5/71073868;4,https://storage.googleapis.com/ts-sys-myts-avatars/d4864285-0b77-4f2d-b0c5-1ae585e66ee5/1260429936 + // 2, is the avatar we want to use. The other ones are away and busy avatars. + return ( + client.properties.myteamspeakAvatar.split("2,")[1] ?? + client.properties.myteamspeakAvatar.split(";")[0].split(",")[1] + ); + } + + return ( +