style: 移除麵包屑首頁項,側邊欄新增儀表板選單並修正選中狀態
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
LayoutDashboard,
|
||||
ChevronRight,
|
||||
Package,
|
||||
ShoppingCart,
|
||||
@@ -59,6 +60,12 @@ export default function AuthenticatedLayout({
|
||||
const [isMobileOpen, setIsMobileOpen] = useState(false);
|
||||
|
||||
const menuItems: MenuItem[] = [
|
||||
{
|
||||
id: "dashboard",
|
||||
label: "儀表板",
|
||||
icon: <LayoutDashboard className="h-5 w-5" />,
|
||||
route: "/",
|
||||
},
|
||||
{
|
||||
id: "inventory-management",
|
||||
label: "商品與庫存管理",
|
||||
@@ -197,7 +204,9 @@ export default function AuthenticatedLayout({
|
||||
const renderMenuItem = (item: MenuItem, level: number = 0) => {
|
||||
const hasChildren = item.children && item.children.length > 0;
|
||||
const isExpanded = expandedItems.includes(item.id);
|
||||
const isActive = item.route ? url.startsWith(item.route) : false;
|
||||
const isActive = item.route
|
||||
? (item.route === '/' ? url === '/' : url.startsWith(item.route))
|
||||
: false;
|
||||
|
||||
return (
|
||||
<div key={item.id} className="mb-1">
|
||||
|
||||
Reference in New Issue
Block a user