generated from Flycro/laravel-nuxt
37 lines
663 B
Vue
37 lines
663 B
Vue
<script setup lang="ts">
|
|
const authStore = useAuthStore()
|
|
|
|
const links = [{
|
|
label: 'Account',
|
|
to: '/account',
|
|
icon: 'i-heroicons-user-solid',
|
|
}, {
|
|
label: 'Logout',
|
|
to: '/logout',
|
|
icon: 'i-heroicons-arrow-left-on-rectangle',
|
|
}]
|
|
|
|
if (authStore.user?.roles.includes('admin')) {
|
|
links.push({
|
|
label: 'Admin',
|
|
to: '/admin',
|
|
icon: 'i-heroicons-cog-solid',
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<UPopover>
|
|
<UButton icon="i-heroicons-user-solid" color="gray" variant="ghost" />
|
|
<template #panel>
|
|
<div class="p-4">
|
|
<UNavigationLinks :links="links" />
|
|
</div>
|
|
</template>
|
|
</UPopover>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|