22 lines
1.1 KiB
Vue
22 lines
1.1 KiB
Vue
<script setup>
|
|
import { Panel, PersonAvatar, formatRelative } from '@inhaus/ui';
|
|
|
|
defineProps({ posts: { type: Array, required: true } });
|
|
</script>
|
|
|
|
<template>
|
|
<Panel title="Aus Ihren Gruppen" action-label="Alle Gruppen" action-href="/gruppen">
|
|
<ul class="ih:-my-1 ih:grid ih:gap-1">
|
|
<li v-for="p in posts" :key="p.id">
|
|
<a :href="p.url" class="ih:-mx-2 ih:flex ih:gap-2.5 ih:rounded-md ih:p-2 ih:hover:bg-accent/50">
|
|
<PersonAvatar v-if="p.user" :person="p.user" class="ih:size-8 ih:text-[11px]" />
|
|
<span class="ih:min-w-0 ih:text-sm">
|
|
<span class="ih:block ih:truncate"><span class="ih:font-medium">{{ p.user?.name }}</span> <span class="ih:text-muted-foreground">in {{ p.group }}</span></span>
|
|
<span class="ih:line-clamp-2 ih:text-[13px] ih:text-muted-foreground">{{ p.text }}</span>
|
|
<span class="ih:text-xs ih:text-muted-foreground">{{ formatRelative(p.created_at) }}</span>
|
|
</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</Panel>
|
|
</template>
|