Add dashboard navigation and request timeouts

Added 'Back to Dashboard' buttons to all admin dashboard pages for improved navigation. Introduced AbortSignal timeouts to API client and middleware requests to prevent hanging network calls. Also enabled messaging customers from the order details page if Telegram info is available.
This commit is contained in:
NotII
2025-10-30 18:35:09 +00:00
parent fcba1a853d
commit f0d18a9e67
9 changed files with 70 additions and 19 deletions

View File

@@ -22,7 +22,8 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Clipboard, Truck, Package, ArrowRight, ChevronDown, AlertTriangle, Copy, Loader2, RefreshCw } from "lucide-react";
import { Clipboard, Truck, Package, ArrowRight, ChevronDown, AlertTriangle, Copy, Loader2, RefreshCw, MessageCircle } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { toast } from "sonner";
import {
@@ -829,6 +830,22 @@ export default function OrderDetailsPage() {
</div>
)}
</div>
{(order?.telegramBuyerId || order?.telegramUsername) && (
<div className="pt-2">
<Button
variant="secondary"
size="sm"
asChild
>
<Link href={`/dashboard/chats/new?buyerId=${order?.telegramBuyerId || order?.telegramUsername}`}
title={`Chat with customer${order?.telegramUsername ? ` @${order.telegramUsername}` : ''}`}
>
<MessageCircle className="h-4 w-4 mr-2" />
Message customer
</Link>
</Button>
</div>
)}
</div>
)}