From 35b573945ec8afbd16a64d5ab2ca14f01c921d35 Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Fri, 5 Sep 2025 23:22:24 +0300 Subject: [PATCH] Fix the structure --- .../src/ui/components/chat/ChatMessages.tsx | 6 ++++-- .../components/chat/MessagePanelRenderer.tsx | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/src/ui/components/chat/ChatMessages.tsx b/frontend/src/ui/components/chat/ChatMessages.tsx index 45aca19..1ba1d4d 100644 --- a/frontend/src/ui/components/chat/ChatMessages.tsx +++ b/frontend/src/ui/components/chat/ChatMessages.tsx @@ -6,15 +6,16 @@ import type { UserProfile } from "../../../core/types"; import { UserProfileDialog } from "./UserProfileDialog"; import { MessageContextMenu, type ContextMenuState } from "./MessageContextMenu"; import { fetchUserProfile } from "../../api/profileApi"; -import { useState } from "react"; +import { useState, type ReactNode } from "react"; import { delay } from "../../../utils/utils"; import { request } from "../../../websocket"; interface ChatMessagesProps { messages?: MessageType[]; + children?: ReactNode; } -export function ChatMessages({ messages: propMessages }: ChatMessagesProps) { +export function ChatMessages({ messages: propMessages, children }: ChatMessagesProps) { const { messages: hookMessages } = useChat(); const { user } = useAppState(); @@ -137,6 +138,7 @@ export function ChatMessages({ messages: propMessages }: ChatMessagesProps) { isLoadingProfile={isLoadingProfile} /> ))} + {children} Свернуть чат - -
- {panelState.isLoading ? ( + + {panelState.isLoading ? ( +
Loading messages...
- ) : ( - <> - -
- - )} -
+
+ ): ( + +
+ + )}