import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router'; import { Card } from '@/components/ui/primitives'; import { useSessionStore } from '@/stores/session'; /** * Область контента комнаты. В Фазе 1 — заглушка: сообщения, голос и видео * появятся в следующих фазах, но маршрутизация и выбор комнаты уже работают. */ export default function GuildView() { const { t } = useTranslation(); const params = useParams<{ guildId?: string; channelId?: string }>(); const guild = useSessionStore((state) => params.guildId === undefined ? null : (state.guilds.find((item) => item.id === params.guildId) ?? null), ); const channel = guild?.channels.find((item) => item.id === params.channelId) ?? null; if (params.channelId === undefined || channel === null) { return ( {t('channels.noSelection.title')} {t('channels.noSelection.body')} ); } const isVoice = channel.type === 'voice'; return ( {isVoice ? '🔊' : '#'} {channel.name} {channel.slowmode_seconds === undefined || channel.slowmode_seconds === 0 ? null : ( slowmode {channel.slowmode_seconds}s )} {t(isVoice ? 'channels.voicePlaceholder.title' : 'channels.chatPlaceholder.title')} {t(isVoice ? 'channels.voicePlaceholder.body' : 'channels.chatPlaceholder.body', { name: channel.name, })} ); }
{t('channels.noSelection.body')}
{t(isVoice ? 'channels.voicePlaceholder.body' : 'channels.chatPlaceholder.body', { name: channel.name, })}