diff --git a/app/(admin)/layout.tsx b/app/(admin)/layout.tsx index 510d7c3..488aad4 100644 --- a/app/(admin)/layout.tsx +++ b/app/(admin)/layout.tsx @@ -15,6 +15,8 @@ export default function AdminLayout({ }) { const sidebar = useStore(useSidebarToggle, (state) => state); + if (!sidebar) return null; + return ( diff --git a/components/admin-panel/sidebar.tsx b/components/admin-panel/sidebar.tsx index 478d435..51fc37e 100644 --- a/components/admin-panel/sidebar.tsx +++ b/components/admin-panel/sidebar.tsx @@ -11,6 +11,8 @@ import { SidebarToggle } from '@/components/admin-panel/sidebar-toggle'; export function Sidebar() { const sidebar = useStore(useSidebarToggle, (state) => state); + if (!sidebar) return null; + return (