import { Outlet } from 'react-router-dom'
import { useAuth } from '@/context/AuthContext'
import { Sidebar } from '@/components/Sidebar'

export function RoleBasedLayout() {
  const { user } = useAuth()

  if (!user) {
    return null
  }

  return (
    <div className="flex min-h-screen bg-gray-100">
      <Sidebar userRole={user.role} />
      <div className="flex-1">
        <main className="p-6">
          <Outlet />
        </main>
      </div>
    </div>
  )
}
