Loheide-eu-mitarbeiterplatt.../resources/js/components/GreetingCard.vue
Friederich Loheide 05b4b79cb3
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m6s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m25s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m23s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m39s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m40s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Titelbild im Profil, durchsuchbare Baum-Auswahl im IT-Ticket (0.20.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 05:20:19 +00:00

60 lines
3.3 KiB
Vue

<script setup>
import { computed } from 'vue';
import { Link } from '@inertiajs/vue3';
import { LogOut, Settings, UserRound, UserRoundPen } from '@lucide/vue';
import AppIcon from '@/components/AppIcon.vue';
import CoverBanner from '@/components/CoverBanner.vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
const props = defineProps({
user: { type: Object, required: true },
profile: { type: Object, required: true },
greeting: { type: String, required: true },
// Zusätzliche Knöpfe aus Plugins (z. B. „Meine IT“)
actions: { type: Array, default: () => [] },
});
const columns = computed(() => ({ 3: 'grid-cols-3', 4: 'grid-cols-4', 5: 'grid-cols-5' })[Math.min(5, 3 + props.actions.length)]);
</script>
<template>
<section class="overflow-hidden rounded-lg border bg-card">
<CoverBanner :image="user.cover_url" class="flex items-center justify-between gap-4 px-6 py-6 text-brand-foreground">
<div class="min-w-0">
<div class="text-sm opacity-85">{{ greeting }},</div>
<div class="mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words">{{ user.name }}</div>
<div class="mt-1.5 line-clamp-2 text-[13px] opacity-85">
{{ profile.job_title || 'Schön, dass Sie da sind!' }}
</div>
</div>
<PersonAvatar :person="user" class="size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl" />
</CoverBanner>
<nav class="grid divide-x" :class="columns" aria-label="Mein Bereich">
<Link :href="`/personen/${user.id}`" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<UserRound class="size-5 text-brand-text" :stroke-width="1.75" />
Mein Profil
</Link>
<Link href="/profil/bearbeiten" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<UserRoundPen class="size-5 text-brand-text" :stroke-width="1.75" />
Profil bearbeiten
</Link>
<Link
v-for="action in actions"
:key="action.href"
:href="action.href"
class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground"
>
<AppIcon :name="action.icon || 'link'" class="size-5 text-brand-text" :stroke-width="1.75" />
{{ action.label }}
</Link>
<a v-if="user.can_admin" href="/admin" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<Settings class="size-5 text-brand-text" :stroke-width="1.75" />
Administration
</a>
<Link v-else href="/logout" method="post" as="button" class="flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground">
<LogOut class="size-5 text-brand-text" :stroke-width="1.75" />
Abmelden
</Link>
</nav>
</section>
</template>