Admin Dashboard
- -
+
+ {sidebarOpen && (
+
setSidebarOpen(false)}
+ />
+ )}
+
+ }
{tab === "services" && }
)
-}
+}
\ No newline at end of file
diff --git a/app/Components/Area_sidebar.tsx b/app/Components/Area_sidebar.tsx
index a87ec75..a94d77b 100644
--- a/app/Components/Area_sidebar.tsx
+++ b/app/Components/Area_sidebar.tsx
@@ -3,7 +3,12 @@ import Link from "next/link";
import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
-export default function Sidebar() {
+interface SidebarProps {
+ isOpen?: boolean;
+ onClose?: () => void;
+}
+
+export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
const pathname = usePathname();
const baseStyle = "px-6 py-8 text-xl cursor-pointer block w-full h-full";
const hoverStyle = "hover:text-black hover:bg-[#FFFAFA]";
@@ -65,22 +70,26 @@ export default function Sidebar() {
init();
}, []);
- useEffect(() => {
- }, [userRole]);
+ const handleLinkClick = () => {
+ if (onClose) {
+ onClose();
+ }
+ };
if (loading) {
return (
-
+
);
}
return (
-
+ setSidebarOpen(false)} />
+
+ Admin Dashboard
+
{["users", "services"].map((t) => (
))}
-
{tab === "users" &&
-