diff --git a/src/page/workspace/channel/thread-pane.tsx b/src/page/workspace/channel/thread-pane.tsx index dca995f..e1ed937 100644 --- a/src/page/workspace/channel/thread-pane.tsx +++ b/src/page/workspace/channel/thread-pane.tsx @@ -2,11 +2,8 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { Loader2, MessageSquarePlus, - X, ArrowLeft, Send, - Flame, - CornerDownRight, } from "lucide-react"; import { api } from "@/client"; import { Button } from "@/components/ui/button"; @@ -26,27 +23,6 @@ function formatTime(iso: string) { return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); } -function formatDate(iso: string) { - const d = new Date(iso); - const now = new Date(); - if (d.toDateString() === now.toDateString()) return "Today"; - const yesterday = new Date(now); - yesterday.setDate(yesterday.getDate() - 1); - if (d.toDateString() === yesterday.toDateString()) return "Yesterday"; - return d.toLocaleDateString([], { - month: "long", - day: "numeric", - year: d.getFullYear() !== now.getFullYear() ? "numeric" : undefined, - }); -} - -function shouldShowDate(current: string, prev?: string): boolean { - if (!prev) return true; - const cur = new Date(current); - const prv = new Date(prev); - return cur.toDateString() !== prv.toDateString(); -} - export default function ThreadPane({ thread, roomId, onClose }: Props) { const [messages, setMessages] = useState([]); const [loading, setLoading] = useState(true); @@ -55,9 +31,6 @@ export default function ThreadPane({ thread, roomId, onClose }: Props) { const bottomRef = useRef(null); const textareaRef = useRef(null); - const creatorName = - thread.created_by.display_name || thread.created_by.username || "User"; - useEffect(() => { let cancelled = false; api @@ -120,7 +93,6 @@ export default function ThreadPane({ thread, roomId, onClose }: Props) { messages: { msg: MessageNewService; showHeader: boolean }[]; }[] = []; - let lastDate: string | undefined; for (let i = 0; i < messages.length; i++) { const msg = messages[i]; const prev = i > 0 ? messages[i - 1] : undefined;