import { PhoneMissed, Signal } from "lucide-react"; import { useServerChannelsStore } from "~/stores/server-channels-store"; import { useServerListStore } from "~/stores/server-list-store"; import { useUsersStore } from "~/stores/users-store"; import { useVoiceStateStore } from "~/stores/voice-state-store"; import { ThemeToggle } from "../theme/theme-toggle"; import { Button } from "../ui/button"; import { Separator } from "../ui/separator"; import UserAvatar from "../user-avatar"; import { OnlineStatus } from "./online-status"; import { SettingsButton } from "./settings-button"; function VoiceStatus({ voiceState }: { voiceState: { serverId: string; channelId: string } }) { // const webrtcState = useWebRTCStore(state => state.status) const leaveVoiceChannel = () => { useVoiceStateStore.getState().leaveVoiceChannel() } const channel = useServerChannelsStore(state => state.channels[voiceState.serverId]?.[voiceState.channelId]) const server = useServerListStore(state => state.servers[voiceState.serverId]) return (
{channel?.name || "Unknown channel"} / {server?.name}
) } export default function UserStatus() { const user = useUsersStore(state => state.getCurrentUser()!) const voiceState = useVoiceStateStore(state => state.activeChannel) return (
{voiceState && <> }
{user?.displayName || user?.username || "Unknown user"}
@{user?.username}
{/* */} {/* */}
) }