麵包屑點擊問題修正
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 51s

This commit is contained in:
2026-01-07 13:12:07 +08:00
parent 8ea1ce1515
commit 19c60a6126
2 changed files with 13 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ import {
BreadcrumbPage, BreadcrumbPage,
BreadcrumbSeparator, BreadcrumbSeparator,
} from "@/Components/ui/breadcrumb"; } from "@/Components/ui/breadcrumb";
import { cn } from "@/lib/utils";
export interface BreadcrumbItemType { export interface BreadcrumbItemType {
label: string; label: string;
@@ -27,12 +28,17 @@ const BreadcrumbNav = ({ items, className }: BreadcrumbNavProps) => {
{items.map((item, index) => ( {items.map((item, index) => (
<React.Fragment key={index}> <React.Fragment key={index}>
<BreadcrumbItem> <BreadcrumbItem>
{item.isPage ? ( {(item.isPage || !item.href || item.href === "#") ? (
<BreadcrumbPage className="text-gray-500">{item.label}</BreadcrumbPage> <BreadcrumbPage className={cn(
"font-medium",
item.isPage ? "text-gray-500" : "text-gray-400 cursor-default"
)}>
{item.label}
</BreadcrumbPage>
) : ( ) : (
<BreadcrumbLink asChild> <BreadcrumbLink asChild>
<Link <Link
href={item.href || "#"} href={item.href}
className="text-[#01ab83] hover:text-[#018a6a] font-medium transition-colors" className="text-[#01ab83] hover:text-[#018a6a] font-medium transition-colors"
> >
{item.label} {item.label}

View File

@@ -11,22 +11,22 @@ export const BREADCRUMB_MAP: Record<string, BreadcrumbItemType[]> = {
products: [ products: [
{ label: "首頁", href: "/" }, { label: "首頁", href: "/" },
{ label: "商品與庫存管理" }, { label: "商品與庫存管理" },
{ label: "商品資料管理", isPage: true } { label: "商品資料管理", href: "/products", isPage: true }
], ],
warehouses: [ warehouses: [
{ label: "首頁", href: "/" }, { label: "首頁", href: "/" },
{ label: "商品與庫存管理" }, { label: "商品與庫存管理" },
{ label: "倉庫管理", isPage: true } { label: "倉庫管理", href: "/warehouses", isPage: true }
], ],
vendors: [ vendors: [
{ label: "首頁", href: "/" }, { label: "首頁", href: "/" },
{ label: "廠商管理" }, { label: "廠商管理" },
{ label: "廠商資料管理", isPage: true } { label: "廠商資料管理", href: "/vendors", isPage: true }
], ],
purchaseOrders: [ purchaseOrders: [
{ label: "首頁", href: "/" }, { label: "首頁", href: "/" },
{ label: "採購管理" }, { label: "採購管理" },
{ label: "管理採購單", isPage: true } { label: "管理採購單", href: "/purchase-orders", isPage: true }
], ],
}; };