diff --git a/src/page/workspace/channel/message-view.tsx b/src/page/workspace/channel/message-view.tsx index ef7c35b..29ccea1 100644 --- a/src/page/workspace/channel/message-view.tsx +++ b/src/page/workspace/channel/message-view.tsx @@ -9,6 +9,7 @@ import { Loader2, MessageSquare, ChevronDown, Pin } from "lucide-react"; import type { MessageNewService } from "@/socket"; import MessageItem, { DateDivider, formatDate } from "./message-item"; import MessageComposer from "./composer"; +import type { Thread } from "./thread-sidebar"; type Props = { roomId: string; @@ -24,6 +25,7 @@ type Props = { onDelete?: (messageId: string) => void; onEdit?: (messageId: string, content: string) => void; onStartThread?: (messageId: string, seq: number) => void; + onViewThread?: (threadId: string, seq: number) => void; onReactionToggle?: ( messageId: string, emoji: string, @@ -34,6 +36,7 @@ type Props = { { content: string; displayName?: string } >; typingText?: string | null; + threads?: Thread[]; }; function shouldShowHeader( @@ -78,9 +81,11 @@ export default function MessageView({ onDelete, onEdit, onStartThread, + onViewThread, onReactionToggle, streamingMessages = new Map(), typingText, + threads, }: Props) { const scrollRef = useRef(null); const bottomRef = useRef(null); @@ -199,13 +204,17 @@ export default function MessageView({ return (
{pinnedMessages.length > 0 && ( -
- - +
+ )}
@@ -233,21 +242,25 @@ export default function MessageView({ ); case "notice_beginning": return ( -
-
- - Beginning of #{roomName} +
+
+ +
+ + Beginning of #{roomName} -
+
); case "notice_scroll": return (
- Scroll up for older messages +
+ Scroll up for older messages +
); case "date": @@ -265,9 +278,11 @@ export default function MessageView({ onPinToggle={onPinToggle} onReactionToggle={onReactionToggle} onStartThread={onStartThread} + onViewThread={onViewThread} onReply={(msg) => setReplyTarget(msg)} roomId={roomId} showHeader={item.showHeader} + threads={threads} /> ); default: @@ -337,8 +352,8 @@ export default function MessageView({ setReplyTarget(null)} - onSend={(content) => { - onSend(content, replyTarget?.id); + onSend={async (content) => { + await onSend(content, replyTarget?.id); setReplyTarget(null); }} onTyping={onTyping}