import React from "react"; import { useParams } from "react-router"; import { Hash, Volume2, Users, HelpCircle, Inbox, Pin } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { useInstanceDetails } from "@/hooks/useServers"; import { useChannels } from "@/hooks/useChannel"; import { useUiStore } from "@/stores/uiStore"; const ChatPage: React.FC = () => { const { instanceId, channelId } = useParams(); const { instance } = useInstanceDetails(instanceId); const { categories } = useChannels(instanceId); const { toggleMemberList, showMemberList } = useUiStore(); // Find current channel const currentChannel = categories ?.flatMap((cat) => cat.channels) ?.find((ch) => ch.id === channelId); // Handle Direct Messages view // if (!instanceId || instanceId === '@me') { // return ( //
// When someone sends you a direct message, it will show up here. //
//The channel you're looking for doesn't exist or you don't have access to it.
{firstChannel ? `Select a channel from the sidebar to start chatting, or head to #${firstChannel.name} to get started.` : "This server doesn't have any channels yet. Create one to get started!"}
This is the start of the #{currentChannel?.name} channel.
No messages yet. Start the conversation!