This commit is contained in:
NotII
2025-03-18 18:19:24 +01:00
parent 740fa0a2dc
commit 2715d3a0e7
2 changed files with 185 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ import { toast } from "sonner";
import { ArrowLeft, Send, RefreshCw, File, FileText, Image as ImageIcon, Download } from "lucide-react";
import { getCookie } from "@/lib/client-utils";
import { ImageViewerModal } from "@/components/modals/image-viewer-modal";
import BuyerOrderInfo from "./BuyerOrderInfo";
interface Message {
_id: string;
@@ -381,20 +382,24 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
return (
<div className="flex flex-col h-screen w-full relative">
<div className="border-b h-16 px-4 flex items-center space-x-2 bg-card z-10">
<Button variant="ghost" size="icon" onClick={handleBackClick}>
<ArrowLeft className="h-5 w-5" />
</Button>
<div className="flex flex-col">
<h3 className="text-lg font-semibold">
Chat with Customer {chat.buyerId.slice(-4)}
</h3>
{chat.telegramUsername && (
<span className="text-sm text-muted-foreground">
@{chat.telegramUsername}
</span>
)}
<div className="border-b h-16 px-4 flex items-center justify-between bg-card z-10">
<div className="flex items-center space-x-2">
<Button variant="ghost" size="icon" onClick={handleBackClick}>
<ArrowLeft className="h-5 w-5" />
</Button>
<div className="flex flex-col">
<h3 className="text-lg font-semibold">
Chat with Customer {chat.buyerId.slice(-4)}
</h3>
{chat.telegramUsername && (
<span className="text-sm text-muted-foreground">
@{chat.telegramUsername}
</span>
)}
</div>
</div>
<BuyerOrderInfo buyerId={chat.buyerId} />
</div>
<div className="flex-1 overflow-y-auto p-2 space-y-2 pb-[80px]">