import { Channel, Message, Server } from "@/types/types"; import MessageBox from "./MessageBox"; import App from "@/types/app"; import React, { Ref, useEffect, useRef } from "react"; import PluginChannel from "./PluginChannel"; export default function ChannelView({ app, messages, ip, serverRef, }: { app: App; messages: Message[]; ip: string; serverRef: React.RefObject; }) { if (!app.currentChannel) return (
); switch (app.currentChannel.kind) { case "text": return ( serverRef.current?.send(JSON.stringify(req))} /> ); case "voice": return null; default: return ( ); } }