26 lines
1.6 KiB
Vue
26 lines
1.6 KiB
Vue
<script setup>
|
||
import { Link } from '@inertiajs/vue3';
|
||
import { ImageOff, MapPin } from '@lucide/vue';
|
||
import StatusBadge from './StatusBadge.vue';
|
||
|
||
defineProps({
|
||
item: { type: Object, required: true },
|
||
});
|
||
</script>
|
||
|
||
<template>
|
||
<article class="ih:group ih:flex ih:flex-col ih:overflow-hidden ih:rounded-lg ih:border ih:bg-card ih:shadow-xs ih:transition-shadow ih:hover:shadow-md">
|
||
<!-- Immer das ganze Bild: in die Fläche eingepasst, mit Rand – nie ein Ausschnitt -->
|
||
<Link :href="item.url" prefetch class="ih:relative ih:block ih:aspect-[4/3] ih:overflow-hidden ih:bg-muted ih:p-3 ih:pt-9">
|
||
<img v-if="item.thumb_url" :src="item.thumb_url" :alt="item.title" loading="lazy" class="ih:size-full ih:object-contain ih:transition-transform ih:duration-300 ih:group-hover:scale-[1.02]" />
|
||
<span v-else class="ih:grid ih:size-full ih:place-items-center"><ImageOff class="ih:size-8 ih:text-muted-foreground" :stroke-width="1.5" /></span>
|
||
<StatusBadge :lent="item.lent" class="ih:absolute ih:top-2 ih:left-2" />
|
||
</Link>
|
||
<div class="ih:flex ih:flex-1 ih:flex-col ih:gap-1 ih:p-3">
|
||
<Link :href="item.url" prefetch class="ih:line-clamp-2 ih:text-[15px] ih:leading-snug ih:font-semibold ih:hover:underline">{{ item.title }}</Link>
|
||
<p v-if="item.location" class="ih:mt-auto ih:flex ih:items-center ih:gap-1 ih:pt-1 ih:text-xs ih:text-muted-foreground">
|
||
<MapPin class="ih:size-3.5 ih:shrink-0" /><span class="ih:truncate">{{ item.location }}</span>
|
||
</p>
|
||
</div>
|
||
</article>
|
||
</template>
|