麵包屑點擊問題修正
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
@@ -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 }
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user