Files
frontend/app/components/BucketList.vue
T
2026-08-21 15:29:01 +02:00

67 lines
2.4 KiB
Vue

<template>
<aside class="flex w-60 shrink-0 flex-col border-r border-border bg-surface">
<div class="flex items-center justify-between px-4 pb-2 pt-5">
<span class="text-xs font-semibold tracking-[0.14em] text-muted">BUCKETS</span>
<span class="rounded-full bg-surface-raised px-2 py-0.5 text-[11px] font-semibold text-muted">
{{ buckets.length }}
</span>
</div>
<nav class="sidebar-scroll flex-1 space-y-0.5 overflow-y-auto px-2.5 pt-1">
<button
v-for="bucket in buckets"
:key="bucket.name"
type="button"
class="group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-sm transition-all duration-150"
:class="bucket.name === selected
? 'bg-accent-dim text-text shadow-[inset_0_0_0_1px_rgba(234,88,12,0.25)]'
: 'text-muted hover:translate-x-0.5 hover:bg-surface-raised hover:text-text'"
@click="$emit('select', bucket.name)"
>
<span
class="flex size-6 shrink-0 items-center justify-center rounded-md transition-colors"
:class="bucket.name === selected ? 'bg-accent text-white' : 'bg-surface-raised text-muted group-hover:text-text'"
>
<span class="material-symbols-outlined !text-[15px]">folder</span>
</span>
<span class="truncate font-medium">{{ bucket.name }}</span>
</button>
<p v-if="!buckets.length" class="px-2.5 py-2 text-sm text-muted">
Keine Buckets gefunden.
</p>
</nav>
<div class="mx-2.5 mb-3 mt-2 border-t border-dashed border-border pt-2.5">
<button
type="button"
class="flex w-full items-center gap-2 rounded-lg border border-dashed border-border px-2.5 py-2 text-sm text-muted transition-colors hover:border-accent hover:text-accent"
@click="$emit('create')"
>
<span class="material-symbols-outlined !text-[18px]">add</span>
Bucket
</button>
</div>
</aside>
</template>
<script setup lang="ts">
import type { S3Bucket } from '~/utils/s3xml'
defineProps<{ buckets: S3Bucket[]; selected: string | null }>()
defineEmits<{ select: [name: string]; create: [] }>()
</script>
<style scoped>
.sidebar-scroll::-webkit-scrollbar {
width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
background-color: var(--color-border);
border-radius: 999px;
}
.sidebar-scroll::-webkit-scrollbar-track {
background-color: transparent;
}
</style>