Loheide-eu-mitarbeiterplatt.../resources/js/components/GreetingCard.vue
Friederich Loheide 50ee85c06b
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m31s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m57s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m46s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m9s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m13s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m30s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m27s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m7s
IT-Service: Baumstruktur, HTML-Antworten, Fehlermeldungen, geschlossene Tickets, Meine IT im Profilkasten
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 20:30:24 +00:00

59 lines
3.2 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 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">
<div class="flex items-center justify-between gap-4 bg-brand 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" />
</div>
<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>