'use client' import { AnimatePresence, motion, useReducedMotion } from 'framer-motion' import React, { useMemo } from 'react' import { usePathname } from 'next/navigation' import AdminRoleGuard from '@/components/auth/AdminRoleGuard' import PendingUserGuard from '@/components/auth/PendingUserGuard' import Sidebar from '@/components/layouts/Sidebar' import SessionProviders from '@/components/providers/SessionProviders' import { SIDEBAR_WIDTH } from '@/config/sidebar' import { AlertModalProvider } from '@/context/AlertModalContext' const DashboardShell = ({ children }: { children: React.ReactNode }) => { const pathname = usePathname() const reduceMotion = useReducedMotion() // Extract key for animation - main routes only const animationKey = useMemo(() => { const segments = pathname.split('/').filter(Boolean) const mainSegments = segments // If on project route, key is just project/[id] if (mainSegments[0] === 'project' && mainSegments[1]) { return `project/${mainSegments[1]}` } // If on match route, key is just match/[id] if (mainSegments[0] === 'match' && mainSegments[1]) { return `match/${mainSegments[1]}` } // For other routes, first segment only return mainSegments[0] || 'root' }, [pathname]) return (
{children}
) } export default DashboardShell