'use client' import { useEffect } from 'react' import { useRouter } from 'next/navigation' import { isAuthenticated } from '@/lib/auth' import { Sidebar } from '@/components/layout/sidebar' interface DashboardLayoutProps { children: React.ReactNode title?: string description?: string } export function DashboardLayout({ children, title, description }: DashboardLayoutProps) { const router = useRouter() useEffect(() => { if (!isAuthenticated()) { router.push('/login') } }, [router]) return (
{/* Main Content Area - responsive margin for sidebar */}
{/* Header */} {(title || description) && (
{title &&

{title}

} {description && (

{description}

)}
)} {/* Page Content - extra top padding on mobile for hamburger button */}
{children}
) }