27 lines
1.2 KiB
Vue
27 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
import type { SessionUser } from '#shared/types';
|
|
|
|
defineProps<{ user: SessionUser | null }>();
|
|
</script>
|
|
|
|
<template>
|
|
<header class="border-b">
|
|
<div class="page flex h-16 items-center justify-between gap-4">
|
|
<NuxtLink to="/" class="text-lg font-bold tracking-tight">{{ t('brand.name') }}</NuxtLink>
|
|
<nav class="hidden items-center gap-6 text-sm md:flex" aria-label="Main">
|
|
<NuxtLink to="/" class="muted hover:opacity-80">{{ t('nav.home') }}</NuxtLink>
|
|
<NuxtLink to="/pricing" class="muted hover:opacity-80">{{ t('nav.pricing') }}</NuxtLink>
|
|
<NuxtLink v-if="user" to="/dashboard" class="muted hover:opacity-80">{{ t('nav.dashboard') }}</NuxtLink>
|
|
<NuxtLink v-if="user?.role === 'admin'" to="/admin" class="muted hover:opacity-80">{{ t('nav.admin') }}</NuxtLink>
|
|
</nav>
|
|
<div class="flex items-center gap-2">
|
|
<ThemeToggle />
|
|
<form v-if="user" action="/api/auth/logout" method="post">
|
|
<button type="submit" class="btn-secondary">{{ t('nav.logout') }}</button>
|
|
</form>
|
|
<NuxtLink v-else to="/login" class="btn-primary">{{ t('nav.login') }}</NuxtLink>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
</template>
|