diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx index 40e91e7..39f6479 100644 --- a/app/dashboard/layout.tsx +++ b/app/dashboard/layout.tsx @@ -3,9 +3,9 @@ import { usePathname, useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import MobileDrawer from "@/components/layout/MobileDrawer"; -import Header from "@/components/layout/Header"; +import TopMenu from "@/components/layout/TopMenu"; import MainContent from "@/components/layout/MainContent"; -import { SiteFooter } from "@/components/ui/footer"; +import SiteFooter from "@/components/layout/Footer"; import { links } from "@/config/menu"; export default function DashboardLayout({ @@ -41,13 +41,12 @@ export default function DashboardLayout({ return (
-
setIsMobileMenuOpen(true)} /> + setIsMobileMenuOpen(true)} /> setIsMobileMenuOpen(false)} /> - {/* Main Content */}
{isHydrated ? ( diff --git a/components/ui/footer.tsx b/components/layout/Footer.tsx similarity index 96% rename from components/ui/footer.tsx rename to components/layout/Footer.tsx index a13c547..376ca2f 100644 --- a/components/ui/footer.tsx +++ b/components/layout/Footer.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Card, CardContent } from "@/components/ui/card"; -export function SiteFooter() { +export default function SiteFooter() { return (
@@ -52,5 +52,3 @@ export function SiteFooter() {
); } - -export default SiteFooter; diff --git a/components/layout/MainContent.tsx b/components/layout/MainContent.tsx index c372a82..fedc2b5 100644 --- a/components/layout/MainContent.tsx +++ b/components/layout/MainContent.tsx @@ -8,15 +8,21 @@ interface MainContentProps { sideLinks?: { [href: string]: string }; } -export default function main_content({ +export default function MainContent({ children, currentPath, sideLinks, }: MainContentProps) { + const pageLabel = + links?.[currentPath?.split("/").slice(0, 3).join("/")].label; return (
{sideLinks && ( - + )}
@@ -25,9 +31,7 @@ export default function main_content({
- {links?.[currentPath?.split("/").slice(0, 3).join("/")]?.label + - " > " + - sideLinks?.[currentPath]} + {pageLabel + " > " + sideLinks?.[currentPath]}
diff --git a/components/layout/SideLinks.tsx b/components/layout/SideLinks.tsx index fa2e041..ae32f29 100644 --- a/components/layout/SideLinks.tsx +++ b/components/layout/SideLinks.tsx @@ -4,11 +4,17 @@ import { getLinkClassName } from "@/utils/link"; interface SideLinksProps { sideLinks: { [href: string]: string }; currentPath: string; + pageLabel: string; } -export default function side_links({ sideLinks, currentPath }: SideLinksProps) { +export default function SideLinks({ + sideLinks, + currentPath, + pageLabel, +}: SideLinksProps) { return (