-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEventCardV2.tsx
More file actions
51 lines (49 loc) · 1.87 KB
/
EventCardV2.tsx
File metadata and controls
51 lines (49 loc) · 1.87 KB
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
import { FC } from "react";
import Image from "next/image";
import { Clock, Pin } from "lucide-react";
import Badge from "@/components/ui/Badge";
import { Card, CardContent, CardFooter } from "@/components/ui/Card";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/Tooltip";
import { EventType } from "@/domains/Events";
import { useFormatDate } from "@/lib/format";
const EventCardV2: FC<{ data: EventType }> = ({ data }) => {
const { title, date, image_event, status, duration, location } = data;
return (
<Card className="flex size-full flex-col rounded-lg border shadow-md">
<div className="bg-muted overflow-hidden rounded-t-lg">
<Image
src={image_event ?? "/assets/images/events/fallbackImage.webp"}
alt={title}
width={540}
height={240}
className="h-40 w-full object-cover object-center md:h-64"
/>
</div>
<CardContent className="px-4 pt-4 pb-0">
<Badge className="mb-2" variant={`${status}`}>
{status}
</Badge>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<h2 className="text-hmc-blue-600 line-clamp-2 text-base font-bold sm:text-xl">{title}</h2>
</TooltipTrigger>
<TooltipContent>{title}</TooltipContent>
</Tooltip>
</TooltipProvider>
</CardContent>
<CardFooter className="mt-auto flex flex-col items-start gap-2 px-4 pt-3 pb-4">
<p className="line-clamp-1">{useFormatDate(date)}</p>
<div className="flex items-center gap-2">
<Clock size={15} />
<p className="text-sm">{duration}</p>
</div>
<div className="flex items-center gap-2">
<Pin size={15} />
<p className="text-sm">{location}</p>
</div>
</CardFooter>
</Card>
);
};
export default EventCardV2;