generated from Flycro/laravel-nuxt
54 lines
976 B
Vue
54 lines
976 B
Vue
<script setup lang="ts">
|
|
import type { NavigationTree } from '#ui-pro/types'
|
|
|
|
const authStore = useAuthStore()
|
|
|
|
const links: NavigationTree[] = [
|
|
{
|
|
label: 'Dashboard',
|
|
to: '/',
|
|
icon: 'i-heroicons-home',
|
|
},
|
|
{
|
|
label: 'Bücher',
|
|
icon: 'i-heroicons-book-open',
|
|
children: [
|
|
{
|
|
label: 'Übersicht',
|
|
to: '/book-recommendations',
|
|
icon: 'i-heroicons-eye',
|
|
},
|
|
],
|
|
},
|
|
]
|
|
|
|
if (authStore.user?.roles.includes('admin')) {
|
|
links.push({
|
|
label: 'Admin',
|
|
to: '/admin',
|
|
icon: 'i-heroicons-cog-solid',
|
|
children: [
|
|
{
|
|
label: 'Übersicht',
|
|
to: '/admin',
|
|
icon: 'i-heroicons-eye',
|
|
},
|
|
{
|
|
label: 'Votes',
|
|
to: '/admin/votes',
|
|
icon: 'i-heroicons-star',
|
|
},
|
|
{
|
|
label: 'Jobs',
|
|
to: '/admin/jobs',
|
|
icon: 'i-heroicons-briefcase',
|
|
},
|
|
],
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<UNavigationTree :links="links" />
|
|
</template>
|