mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-19 00:17:01 +00:00
Breadcrumbs
This commit is contained in:
parent
ec8c5ffc03
commit
c37bf1d9f9
@ -10,8 +10,12 @@ interface DashboardPageProps {
|
|||||||
export default function DashboardPage({ username, name }: DashboardPageProps) {
|
export default function DashboardPage({ username, name }: DashboardPageProps) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Sidebar username={username} fullName={name}>
|
<Sidebar
|
||||||
<main>
|
username={username}
|
||||||
|
fullName={name}
|
||||||
|
breadcrumbPath={['Home', 'Dashboard']}
|
||||||
|
>
|
||||||
|
<main className="pl-4">
|
||||||
<h1>Dashboard</h1>
|
<h1>Dashboard</h1>
|
||||||
</main>
|
</main>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
|
|||||||
25
components/Breadcrumbs.tsx
Normal file
25
components/Breadcrumbs.tsx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
interface BreadcrumbsProps {
|
||||||
|
breadcrumbPath?: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Breadcrumbs({ breadcrumbPath = ['Home'] }: BreadcrumbsProps) {
|
||||||
|
return(
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="breadcrumbs text-sm">
|
||||||
|
<ul className="pl-4 pt-4">
|
||||||
|
{breadcrumbPath.map((item, index) => (
|
||||||
|
<li key={index}>
|
||||||
|
{index < breadcrumbPath.length - 1 ? (
|
||||||
|
<a>{item}</a>
|
||||||
|
) : (
|
||||||
|
item
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
<div className="divider"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import type React from "react"
|
import type React from "react"
|
||||||
|
import Breadcrumbs from "./Breadcrumbs"
|
||||||
|
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
@ -25,9 +26,10 @@ interface SidebarProps {
|
|||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
username: string
|
username: string
|
||||||
fullName: string
|
fullName: string
|
||||||
|
breadcrumbPath?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Sidebar({ children, username, fullName }: SidebarProps) {
|
export default function Sidebar({ children, username, fullName, breadcrumbPath }: SidebarProps) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const [isProfileOpen, setIsProfileOpen] = useState(false)
|
const [isProfileOpen, setIsProfileOpen] = useState(false)
|
||||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
|
||||||
@ -176,7 +178,10 @@ export default function Sidebar({ children, username, fullName }: SidebarProps)
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
{/* Main content */}
|
{/* Main content */}
|
||||||
<main className="flex-1 p-4 md:p-6 overflow-auto">{children}</main>
|
<main className="flex-1 overflow-auto">
|
||||||
|
<Breadcrumbs breadcrumbPath={breadcrumbPath} />
|
||||||
|
{children}
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user