| 1 |
import { Outlet, Link, useLocation } from "react-router-dom"; |
| 2 |
|
| 3 |
import Header from "../../../bpl-tools/Admin/Header"; |
| 4 |
|
| 5 |
const navigation = [ |
| 6 |
{ name: "Welcome", href: "/welcome" }, |
| 7 |
{ name: "Demos", href: "/demos" }, |
| 8 |
{ name: "Blocks", href: "/blocks" }, |
| 9 |
{ name: "Pricing", href: "/pricing" }, |
| 10 |
{ name: "Feature Comparison", href: "/feature-comparison" }, |
| 11 |
{ name: "Settings", href: "/settings" }, |
| 12 |
]; |
| 13 |
|
| 14 |
const Layout = (props) => { |
| 15 |
const location = useLocation(); |
| 16 |
|
| 17 |
return ( |
| 18 |
<div className="bPlDashboard"> |
| 19 |
<Header {...props}> |
| 20 |
<nav className="bPlDashboardNav"> |
| 21 |
{navigation?.map((item, index) => ( |
| 22 |
<Link |
| 23 |
key={index} |
| 24 |
to={item.href} |
| 25 |
className={`navLink ${ |
| 26 |
location.pathname === item.href ? "active" : "" |
| 27 |
}`}> |
| 28 |
{item.name} |
| 29 |
</Link> |
| 30 |
))} |
| 31 |
</nav> |
| 32 |
</Header> |
| 33 |
|
| 34 |
<main className="bPlDashboardMain"> |
| 35 |
<Outlet /> |
| 36 |
</main> |
| 37 |
</div> |
| 38 |
); |
| 39 |
}; |
| 40 |
export default Layout; |
| 41 |
|