import { isSuperAdmin } from '../utils/auth'

export default defineNuxtRouteMiddleware(() => {
  const { user } = useAuth()
  const localePath = useLocalePath()
  if (!isSuperAdmin(user.value)) {
    return navigateTo(localePath('/dashboard'))
  }
})
