麵包屑點擊問題修正
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
BreadcrumbPage,
|
||||
BreadcrumbSeparator,
|
||||
} from "@/Components/ui/breadcrumb";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export interface BreadcrumbItemType {
|
||||
label: string;
|
||||
@@ -27,12 +28,17 @@ const BreadcrumbNav = ({ items, className }: BreadcrumbNavProps) => {
|
||||
{items.map((item, index) => (
|
||||
<React.Fragment key={index}>
|
||||
<BreadcrumbItem>
|
||||
{item.isPage ? (
|
||||
<BreadcrumbPage className="text-gray-500">{item.label}</BreadcrumbPage>
|
||||
{(item.isPage || !item.href || item.href === "#") ? (
|
||||
<BreadcrumbPage className={cn(
|
||||
"font-medium",
|
||||
item.isPage ? "text-gray-500" : "text-gray-400 cursor-default"
|
||||
)}>
|
||||
{item.label}
|
||||
</BreadcrumbPage>
|
||||
) : (
|
||||
<BreadcrumbLink asChild>
|
||||
<Link
|
||||
href={item.href || "#"}
|
||||
href={item.href}
|
||||
className="text-[#01ab83] hover:text-[#018a6a] font-medium transition-colors"
|
||||
>
|
||||
{item.label}
|
||||
|
||||
@@ -11,22 +11,22 @@ export const BREADCRUMB_MAP: Record<string, BreadcrumbItemType[]> = {
|
||||
products: [
|
||||
{ label: "首頁", href: "/" },
|
||||
{ label: "商品與庫存管理" },
|
||||
{ label: "商品資料管理", isPage: true }
|
||||
{ label: "商品資料管理", href: "/products", isPage: true }
|
||||
],
|
||||
warehouses: [
|
||||
{ label: "首頁", href: "/" },
|
||||
{ label: "商品與庫存管理" },
|
||||
{ label: "倉庫管理", isPage: true }
|
||||
{ label: "倉庫管理", href: "/warehouses", isPage: true }
|
||||
],
|
||||
vendors: [
|
||||
{ label: "首頁", href: "/" },
|
||||
{ label: "廠商管理" },
|
||||
{ label: "廠商資料管理", isPage: true }
|
||||
{ label: "廠商資料管理", href: "/vendors", isPage: true }
|
||||
],
|
||||
purchaseOrders: [
|
||||
{ label: "首頁", href: "/" },
|
||||
{ label: "採購管理" },
|
||||
{ label: "管理採購單", isPage: true }
|
||||
{ label: "管理採購單", href: "/purchase-orders", isPage: true }
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user