game-village-politics-frontend/app/components/ui/SideMenu.vue

23 lines
897 B
Vue

<script setup lang="ts">
import type { RouteLocationRaw } from 'vue-router'
defineProps<{ items: { key: string; label: string; to: RouteLocationRaw; active: boolean; count?: number }[] }>()
</script>
<!-- A list page's sub-menu on the left, like the report and message folders in Die Stämme. -->
<template>
<nav class="border border-wood-700 bg-parchment-200 text-[13px]">
<NuxtLink
v-for="item in items"
:key="item.key"
:to="item.to"
class="flex items-center justify-between border-b border-parchment-300 px-2 py-1 font-semibold last:border-b-0"
:class="item.active ? 'bg-wood-800 text-gold-400' : 'text-wood-950 hover:bg-parchment-100 hover:text-blood-700'"
:aria-current="item.active ? 'page' : undefined"
>
{{ item.label }}
<span v-if="item.count" class="tabular-nums">({{ item.count }})</span>
</NuxtLink>
</nav>
</template>