feat: order cancel button and reorder link on order detail page

This commit is contained in:
zetaloop
2026-02-20 18:50:53 +08:00
parent 07754069c1
commit 922d656056
+12 -3
View File
@@ -6,6 +6,7 @@ import {
MessageSquare, MessageSquare,
RefreshCw, RefreshCw,
Star, Star,
XCircle,
} from "lucide-react" } from "lucide-react"
import Link from "next/link" import Link from "next/link"
import { notFound } from "next/navigation" import { notFound } from "next/navigation"
@@ -205,6 +206,12 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
)} )}
<div className="flex gap-2 flex-wrap"> <div className="flex gap-2 flex-wrap">
{order.status === "pending_accept" && (
<Button variant="outline">
<XCircle className="mr-1 h-4 w-4" />
</Button>
)}
{(order.status === "in_progress" || order.status === "pending_close") && chatSession && ( {(order.status === "in_progress" || order.status === "pending_close") && chatSession && (
<Button asChild> <Button asChild>
<Link href={`/chat/${chatSession.id}`}> <Link href={`/chat/${chatSession.id}`}>
@@ -230,9 +237,11 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
</Button> </Button>
)} )}
{order.status === "completed" && ( {order.status === "completed" && (
<Button variant="outline"> <Button variant="outline" asChild>
<RefreshCw className="mr-1 h-4 w-4" /> <Link href={`/order/new?serviceId=${order.service.id}`}>
<RefreshCw className="mr-1 h-4 w-4" />
</Link>
</Button> </Button>
)} )}
</div> </div>