import { PRODUCT_NAME } from "../../../core/config"; import { useDialog } from "../../contexts/DialogContext"; import { useChat } from "../../hooks/useChat"; import { useAppState } from "../../state"; import defaultAvatar from "../../../resources/images/default-avatar.png"; import { useState, type FormEvent } from "react"; import { ProfileDialog } from "../profile/ProfileDialog"; import { SettingsDialog } from "../settings/SettingsDialog"; import { DMUsersList } from "./DMUsersList"; import type { Tabs } from "mdui"; import type { ChatTabs } from "../../state"; function BottomAppBar() { const [settingsOpen, onSettingsOpenChange] = useState(false); const { logout } = useAppState(); const handleLogout = () => { logout(); }; return ( <> onSettingsOpenChange(true)}>
); } function ChatTabs() { const { chat, switchToTab, switchToPublicChat } = useAppState(); const { activeTab } = chat; const handleChatClick = async (chatName: string) => { await switchToPublicChat(chatName); }; const handleTabChange = async (e: FormEvent) => { const tab = (e.target as Tabs).value as ChatTabs; await switchToTab(tab); }; return (
Чаты Каналы Контакты ЛС handleChatClick("Общий чат")} style={{ cursor: "pointer" }} > handleChatClick("Общий чат 2")} style={{ cursor: "pointer" }} > Скоро будет... Скоро будет...
); } function ChatHeader() { const [isProfileOpen, setProfileOpen] = useState(false); return (
{PRODUCT_NAME}
setProfileOpen(true)}>
); } export function LeftPanel() { return (
); }