import { Channel, Message, Server } from "@/types/types"; import MessageBox from "./MessageBox"; import App from "@/types/app"; import React, { Ref } from "react"; export default function ChannelView({ app, messages, ip, serverRef, }: { app: App; messages: Record; ip: string; serverRef: React.RefObject; }) { if (!app.currentChannel) return (
); switch (app.currentChannel.kind) { case "text": return ( m.channel_id === app.currentChannel?.id ) || [] } sendMessage={(message) => { serverRef.current?.send( JSON.stringify({ type: "send_message", params: { channel_id: app.currentChannel?.id, contents: message, }, }) ); }} /> ); case "voice": return null; default: return