feat: add executable actions to order flow
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
import {
|
||||
AlertTriangle,
|
||||
ArrowLeft,
|
||||
CheckCircle,
|
||||
Clock,
|
||||
MessageSquare,
|
||||
RefreshCw,
|
||||
Star,
|
||||
XCircle,
|
||||
} from "lucide-react"
|
||||
import { ArrowLeft, CheckCircle, Clock, Star } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { notFound } from "next/navigation"
|
||||
import OrderActions from "@/components/order-actions"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { statusLabels } from "@/lib/constants"
|
||||
@@ -195,46 +186,12 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
|
||||
</Card>
|
||||
)}
|
||||
|
||||
<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 && (
|
||||
<Button asChild>
|
||||
<Link href={`/chat/${chatSession.id}`}>
|
||||
<MessageSquare className="mr-1 h-4 w-4" />
|
||||
聊天
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
{order.status === "pending_review" && (
|
||||
<Button asChild>
|
||||
<Link href={`/review/${order.id}`}>
|
||||
<Star className="mr-1 h-4 w-4" />
|
||||
评价
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
{["in_progress", "pending_close"].includes(order.status) && (
|
||||
<Button variant="destructive" asChild>
|
||||
<Link href={`/dispute/${order.id}`}>
|
||||
<AlertTriangle className="mr-1 h-4 w-4" />
|
||||
发起争议
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
{order.status === "completed" && (
|
||||
<Button variant="outline" asChild>
|
||||
<Link href={`/order/new?serviceId=${order.service.id}`}>
|
||||
<RefreshCw className="mr-1 h-4 w-4" />
|
||||
再来一单
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<OrderActions
|
||||
orderId={order.id}
|
||||
initialStatus={order.status}
|
||||
chatSessionId={chatSession?.id}
|
||||
serviceId={order.service.id}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user