This commit is contained in:
MythEclipse
2026-06-03 15:01:34 +07:00
parent 99190a830a
commit 7904d7f38d
9 changed files with 422 additions and 173 deletions
+2 -18
View File
@@ -17,13 +17,11 @@ import {
} from "./shared/api/client";
import { useAudioPlayback } from "./shared/hooks/useAudioPlayback";
import { useAudioTransmit } from "./shared/hooks/useAudioTransmit";
import { useMascotChat } from "./shared/hooks/useMascotChat";
import { useUIState } from "./shared/hooks/useUIState";
import { Skeleton } from "./shared/ui";
import { MobileTabBar } from "./shared/ui/MobileTabBar";
import { useDashboardSocket } from "./shared/ws/socket";
import { DashboardLayout } from "./widgets/DashboardLayout";
import { MascotChatbot } from "./widgets/mascot/MascotChatbot";
const AnalyticsPanel = lazy(() =>
import("./features/analytics").then((module) => ({
@@ -62,15 +60,6 @@ export default function App() {
!!localStorage.getItem("admin-password"),
);
const [monitorGuildId, setMonitorGuildId] = useState("");
const [isMascotChatOpen, setIsMascotChatOpen] = useState(false);
// Mascot chat hook with message context
const mascotChat = useMascotChat({
messageCount: messages.messages.length,
activeParticipants: new Set(messages.messages.map((m) => m.user_id)).size,
lastActivity: messages.messages.length > 0 ? "Active" : "Idle",
topicsDiscussed: ["Analytics", "Conversation", "Insights"],
});
const audio = useAudioPlayback();
const activeTab = uiState.activeTab || "live";
@@ -174,6 +163,8 @@ export default function App() {
voiceStatus={voice.voiceStatus}
onTabChange={(tab) => patchUIState({ activeTab: tab })}
recentMessages={messages.messages}
guildId={monitorGuildId}
channelId={uiState.selectedTextChannel || uiState.selectedVoiceChannel || undefined}
>
{activeTab === "live" ? (
!isAuthenticated ? (
@@ -246,13 +237,6 @@ export default function App() {
onTabChange={(tab) => patchUIState({ activeTab: tab })}
/>
<ModerationAlertListener />
<MascotChatbot
isOpen={isMascotChatOpen}
onSetIsOpen={setIsMascotChatOpen}
onSendMessage={mascotChat.handleSendMessage}
mascotName="Discord Watcher"
mascotAvatar="https://raw.githubusercontent.com/IMPHNEN/imphnen-frontend-service/develop/apps/dimentorin/public/image/mascot-1.png"
/>
</DashboardLayout>
);
}