Gruppen-Plugin 1.0.0
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
5bdfb8a082
49 changed files with 4679 additions and 0 deletions
27
resources/js/components/GroupCard.vue
Normal file
27
resources/js/components/GroupCard.vue
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script setup>
|
||||
import { Link, router } from '@inertiajs/vue3';
|
||||
import { Globe, Lock, EyeOff, Users } from '@lucide/vue';
|
||||
import { Button } from '@inhaus/ui';
|
||||
|
||||
const props = defineProps({ group: { type: Object, required: true } });
|
||||
const icons = { open: Globe, closed: Lock, secret: EyeOff };
|
||||
const join = () => router.post(`/gruppen/${props.group.slug}/beitreten`, {}, { preserveScroll: true });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<article class="ih:flex ih:flex-col ih:overflow-hidden ih:rounded-xl ih:border ih:bg-card ih:shadow-xs">
|
||||
<Link :href="group.url" class="ih:block ih:h-24 ih:bg-brand ih:bg-cover ih:bg-center" :style="group.cover_url ? { backgroundImage: `url(${group.cover_url})` } : {}" :aria-label="group.name" />
|
||||
<div class="ih:flex ih:flex-1 ih:flex-col ih:gap-1 ih:p-4">
|
||||
<Link :href="group.url" class="ih:font-semibold ih:hover:underline">{{ group.name }}</Link>
|
||||
<p class="ih:flex ih:items-center ih:gap-1.5 ih:text-xs ih:text-muted-foreground">
|
||||
<component :is="icons[group.privacy]" class="ih:size-3.5" /> {{ group.privacy_label }} · <Users class="ih:size-3.5" /> {{ group.members_count }}
|
||||
</p>
|
||||
<p v-if="group.description" class="ih:line-clamp-2 ih:text-sm ih:text-muted-foreground">{{ group.description }}</p>
|
||||
<div class="ih:mt-auto ih:pt-3">
|
||||
<Button v-if="group.status === 'active'" variant="outline" size="sm" class="ih:w-full" as-child><Link :href="group.url">Ansehen</Link></Button>
|
||||
<Button v-else-if="group.status === 'pending'" variant="outline" size="sm" class="ih:w-full" disabled>Angefragt</Button>
|
||||
<Button v-else size="sm" class="ih:w-full" @click="join">{{ group.status === 'invited' ? 'Einladung annehmen' : group.privacy === 'open' ? 'Beitreten' : 'Beitritt anfragen' }}</Button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue