fix: broken route links — dispute notification, chat hardcoding, dead sidebar link
This commit is contained in:
@@ -13,7 +13,7 @@ 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 { mockOrders, mockReviews } from "@/lib/mock-data"
|
||||
import { mockChatSessions, mockOrders, mockReviews } from "@/lib/mock-data"
|
||||
import type { OrderStatus } from "@/lib/types"
|
||||
|
||||
const statusLabels: Record<OrderStatus, string> = {
|
||||
@@ -42,6 +42,7 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
|
||||
if (!order) notFound()
|
||||
|
||||
const reviews = mockReviews.filter((r) => r.orderId === id)
|
||||
const chatSession = mockChatSessions.find((s) => s.orderId === id)
|
||||
const currentStepIndex = statusSteps.indexOf(order.status)
|
||||
|
||||
return (
|
||||
@@ -204,9 +205,9 @@ export default async function OrderDetailPage({ params }: { params: Promise<{ id
|
||||
)}
|
||||
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{(order.status === "in_progress" || order.status === "pending_close") && (
|
||||
{(order.status === "in_progress" || order.status === "pending_close") && chatSession && (
|
||||
<Button asChild>
|
||||
<Link href={`/chat/chat1`}>
|
||||
<Link href={`/chat/${chatSession.id}`}>
|
||||
<MessageSquare className="mr-1 h-4 w-4" />
|
||||
聊天
|
||||
</Link>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Badge } from "@/components/ui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||
import { mockOrders } from "@/lib/mock-data"
|
||||
import { mockChatSessions, mockOrders } from "@/lib/mock-data"
|
||||
import type { OrderStatus } from "@/lib/types"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { useAuthStore } from "@/store/auth"
|
||||
@@ -101,14 +101,18 @@ export default function OrderListPage() {
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
{order.status === "in_progress" && (
|
||||
{order.status === "in_progress" &&
|
||||
(() => {
|
||||
const session = mockChatSessions.find((s) => s.orderId === order.id)
|
||||
return session ? (
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
<Link href={`/chat/chat1`}>
|
||||
<Link href={`/chat/${session.id}`}>
|
||||
<MessageSquare className="mr-1 h-3.5 w-3.5" />
|
||||
聊天
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
) : null
|
||||
})()}
|
||||
{order.status === "completed" && (
|
||||
<Button variant="outline" size="sm">
|
||||
<RefreshCw className="mr-1 h-3.5 w-3.5" />
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
Gamepad2,
|
||||
LayoutDashboard,
|
||||
ListOrdered,
|
||||
Palette,
|
||||
Settings2,
|
||||
Store,
|
||||
Users,
|
||||
} from "lucide-react"
|
||||
import { Gamepad2, LayoutDashboard, ListOrdered, Palette, Store, Users } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { cn } from "@/lib/utils"
|
||||
@@ -25,7 +17,6 @@ const ownerLinks = [
|
||||
{ href: "/dashboard/shop", label: "店铺管理", icon: Store },
|
||||
{ href: "/dashboard/shop/employees", label: "员工管理", icon: Users },
|
||||
{ href: "/dashboard/shop/templates", label: "模板编辑", icon: Palette },
|
||||
{ href: "/dashboard/settings", label: "店铺设置", icon: Settings2 },
|
||||
]
|
||||
|
||||
export function DashboardSidebar() {
|
||||
|
||||
+1
-1
@@ -496,7 +496,7 @@ export const mockNotifications: Notification[] = [
|
||||
title: "争议处理中",
|
||||
content: "你发起的订单争议正在审核中",
|
||||
read: true,
|
||||
link: "/dispute/d1",
|
||||
link: "/dispute/ord4",
|
||||
createdAt: "2025-02-12T10:05:00",
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user