diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index f193c6e..d12d790 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -1,9 +1,23 @@ import { Sidebar } from "@/app/components/Sidebar"; +import { FaDoorClosed, FaRegUser } from "react-icons/fa"; +import { FiSettings } from "react-icons/fi"; +import { IoMdStats } from "react-icons/io"; +import { MdInbox } from "react-icons/md"; export default function Layout({ children }: { children: React.ReactNode }) { + const sidebarItems = [ + [ + { href: "/admin", title: "Dashboard", icon: }, + { href: "/admin/users", title: "Users", icon: }, + { href: "/admin/classes", title: "Classes", icon: }, + { href: "/admin/rooms", title: "Rooms", icon: }, + ], + [{ href: "/admin/settings", title: "Settings", icon: }], + ]; + return (
- +
{children}
); diff --git a/src/app/components/Sidebar/index.tsx b/src/app/components/Sidebar/index.tsx index 6e2e17e..0ba1b94 100644 --- a/src/app/components/Sidebar/index.tsx +++ b/src/app/components/Sidebar/index.tsx @@ -1,16 +1,21 @@ "use client"; import { Divider, Link } from "@nextui-org/react"; -import { useRouter } from "next/navigation"; -import { FaDoorClosed, FaRegUser } from "react-icons/fa"; -import { FiSettings } from "react-icons/fi"; -import { IoMdStats } from "react-icons/io"; -import { MdInbox } from "react-icons/md"; +import { usePathname, useRouter } from "next/navigation"; import { ThemeSwitcher } from "../ThemeSwitcher/ThemeSwitcher"; import { SidebarItem } from "./item"; -export const Sidebar = () => { +export const Sidebar = ({ + items, +}: { + items: { + href: string; + title: string; + icon: React.ReactNode; + }[][]; +}) => { const router = useRouter(); + const pathName = usePathname(); return (