feat: add dashboard page with Nuxt UI components and verified middleware

This commit is contained in:
2026-03-19 23:15:23 +01:00
parent a096704b0b
commit 4ea87c0cf7
6 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,58 @@
<script setup lang="ts">
import { useForm } from '@inertiajs/vue3'
import Logo from '@/components/common/Logo.vue'
import { useAuth } from '@/composables/useAuth'
const { user } = useAuth()
const logoutForm = useForm({})
function logout() {
logoutForm.post('/logout')
}
const sidebarLinks = [
{
label: 'Dashboard',
icon: 'i-lucide-house',
to: '/dashboard',
},
]
</script>
<template>
<UApp>
<UDashboardGroup>
<UDashboardSidebar collapsible>
<template #header>
<Logo :link-to-home="false" size="sm" />
</template>
<UNavigationMenu :items="sidebarLinks" />
<template #footer>
<div class="flex items-center gap-2 px-2">
<UAvatar :alt="user?.full_name" size="sm" />
<div class="flex-1 truncate text-sm">
<p class="font-medium truncate">
{{ user?.full_name }}
</p>
<p class="text-muted truncate text-xs">
{{ user?.email }}
</p>
</div>
<UButton
icon="i-lucide-log-out"
variant="ghost"
size="sm"
:loading="logoutForm.processing"
@click="logout"
/>
</div>
</template>
</UDashboardSidebar>
<slot />
</UDashboardGroup>
</UApp>
</template>