blob: b615c2dff867215a1a55b9f346a8aa5f7003bcfd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
---
import { Badge } from '@/components/ui/badge'
import { formatDate, iconMappings } from '@/lib/utils'
import { Icon } from 'astro-icon/components'
import { Image } from 'astro:assets'
import type { CollectionEntry } from 'astro:content'
import Link from './Link.astro'
interface Props {
entry: CollectionEntry<'events'>
}
const { entry } = Astro.props
const formattedDate = formatDate(entry.data.date)
---
<div
class="hover:bg-muted/50 rounded-xl border p-4 transition-colors duration-300 ease-in-out"
>
<Link
href={`/${entry.collection}/${entry.id}`}
class="flex flex-col gap-4 sm:flex-row"
>
{
entry.data.image && (
<div class="w-full sm:max-w-3xs sm:shrink-0">
<Image
src={entry.data.image}
alt={entry.data.title}
width={1200}
height={630}
class="object-cover"
/>
</div>
)
}
<div class="grow">
<h3 class="mb-1 text-lg font-medium">{entry.data.title}</h3>
<p class="text-muted-foreground mb-2 text-sm">{entry.data.description}</p>
<div
class="text-muted-foreground mb-2 flex flex-wrap items-center gap-x-2 text-xs"
>
<span>{formattedDate}</span>
</div>
{
entry.data.type && (
<div class="flex flex-wrap gap-2">
<Badge variant="muted" className="flex items-center gap-x-1">
<Icon
name={iconMappings[entry.data.type] || 'lucide:hash'}
class="size-3"
/>
{entry.data.type}
</Badge>
</div>
)
}
</div>
</Link>
</div>
|