|
1 |
| -import { FC } from "react"; |
2 |
| -import Image from "next/image"; |
| 1 | +import { CSSProperties, FC } from "react"; |
3 | 2 | import { Clock, Pin } from "lucide-react";
|
4 | 3 |
|
5 | 4 | import { Badge } from "@/components/ui/badge";
|
6 | 5 | import { Card, CardContent, CardFooter } from "@/components/ui/card";
|
7 | 6 | import { EventType } from "../types";
|
| 7 | +import Image from "next/image"; |
8 | 8 |
|
9 | 9 | const CardEvent: FC<{ data: EventType }> = ({ data }) => {
|
10 | 10 | const { id, title, date_event, status, duration, location, image_event } = data;
|
11 | 11 | return (
|
12 |
| - <Card key={id} className="border rounded-lg shadow-md flex min-h-28"> |
| 12 | + <Card |
| 13 | + key={id} |
| 14 | + className="min-h-28 flex border rounded-lg shadow-md bg-cover bg-center bg-[image:var(--image-url)] md:bg-none" |
| 15 | + style={{ "--image-url": `url(${image_event})` } as CSSProperties} |
| 16 | + > |
13 | 17 | <Image
|
14 | 18 | src={image_event}
|
15 | 19 | alt={title}
|
16 | 20 | width={150}
|
17 | 21 | height={150}
|
18 |
| - className="rounded-l-lg object-cover w-64 min-h-36" |
| 22 | + className="hidden md:block rounded-l-lg object-cover w-64 min-h-36" |
19 | 23 | />
|
20 |
| - <div className="px-4 py-6"> |
| 24 | + <div className="w-full bg-black/70 py-4"> |
21 | 25 | <CardContent className="pb-0">
|
22 | 26 | <Badge className="mb-2" variant={`${status}`}>
|
23 | 27 | {status}
|
24 | 28 | </Badge>
|
25 |
| - <h2 className="text-xl font-bold text-hmc-blue-600">{title}</h2> |
26 |
| - <p className="text-gray-800">{date_event}</p> |
| 29 | + <h2 className="text-base sm:text-xl font-bold text-hmc-blue-600">{title}</h2> |
| 30 | + <p className="text-gray-100">{date_event}</p> |
27 | 31 | </CardContent>
|
28 |
| - <CardFooter className="flex gap-2 text-gray-500 mt-2 pb-2"> |
| 32 | + <CardFooter className="flex flex-wrap gap-2 text-gray-200 mt-2 pb-2 sm:flex-row"> |
29 | 33 | <div className="flex items-center gap-2">
|
30 | 34 | <Clock size={15} />
|
31 |
| - <p className="text-sm">{duration}</p> |
| 35 | + <p className="text-sm text-nowrap">{duration}</p> |
32 | 36 | </div>
|
33 | 37 | <div className="flex items-center gap-2">
|
34 | 38 | <Pin size={15} />
|
35 |
| - <p className="text-sm">{location}</p> |
| 39 | + <p className="text-sm text-nowrap">{location}</p> |
36 | 40 | </div>
|
37 | 41 | </CardFooter>
|
38 | 42 | </div>
|
|
0 commit comments