import { Navigate } from 'react-router-dom'
import { useAuth } from '../context/AuthContext'

export default function AdminHomeRedirect() {
  const { user } = useAuth()
  const isSuper = user?.role === 'superadmin'
  return <Navigate to={isSuper ? '/admin/hierarchy' : '/'} replace />
}
