From cc1f37633c98fce2045b65a52ca701db1855fa4c Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Tue, 4 Feb 2025 13:46:39 +0800 Subject: [PATCH] feat(dashboard): create DashboardLayout component and refactor DashboardPage --- src/app/dashboard/layout.tsx | 49 ++++++++++++++++++++++++++++++ src/app/dashboard/page.tsx | 58 ++++++------------------------------ 2 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 src/app/dashboard/layout.tsx diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx new file mode 100644 index 0000000..c54bea2 --- /dev/null +++ b/src/app/dashboard/layout.tsx @@ -0,0 +1,49 @@ +import { AppSidebar } from "@/components/app-sidebar"; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, +} from "@/components/ui/breadcrumb"; +import { Separator } from "@/components/ui/separator"; +import { + SidebarInset, + SidebarProvider, + SidebarTrigger, +} from "@/components/ui/sidebar"; + +interface DashboardLayoutProps { + children: React.ReactNode; +} + +export default function DashboardLayout({ children }: DashboardLayoutProps) { + return ( + + + +
+
+ + + + + + + Building Your Application + + + + + Data Fetching + + + +
+
+
{children}
+
+
+ ); +} diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 4bfe34b..10d53d2 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,52 +1,12 @@ -import { AppSidebar } from "@/components/app-sidebar"; -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from "@/components/ui/breadcrumb"; -import { Separator } from "@/components/ui/separator"; -import { - SidebarInset, - SidebarProvider, - SidebarTrigger, -} from "@/components/ui/sidebar"; - -export default function Page() { +export default function DashboardPage() { return ( - - - -
-
- - - - - - - Building Your Application - - - - - Data Fetching - - - -
-
-
-
-
-
-
-
-
-
- - +
+
+
+
+
+
+
+
); }