|
1 | 1 | --- |
2 | 2 | import Layout from '../layouts/Layout.astro' |
3 | 3 | import events from '../assets/events.json' |
| 4 | +import CardEvent from '../components/CardEvent.astro' |
| 5 | +import type { Event } from '../interfaces/events' |
4 | 6 | --- |
5 | 7 |
|
6 | 8 | <Layout title="Events - Ecuador In Tech"> |
7 | 9 | <div class="container mx-auto px-4 py-12" x-data="{ selectedEvent: null }"> |
8 | 10 | <h1 class="text-4xl font-bold mb-8">Eventos</h1> |
9 | 11 | <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> |
10 | 12 | { |
11 | | - events.map((event, index) => ( |
12 | | - <div |
13 | | - class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300 cursor-pointer" |
14 | | - > |
15 | | - <div class="h-48 overflow-hidden relative"> |
16 | | - <img |
17 | | - src={event.image} |
18 | | - alt={event.title} |
19 | | - class="w-full h-full object-cover transform hover:scale-105 transition-transform duration-300" |
20 | | - /> |
21 | | - <div class="absolute top-4 right-4"> |
22 | | - <span |
23 | | - class={`px-3 py-1 rounded-full text-sm font-semibold ${ |
24 | | - event.modality === "Hybrid" |
25 | | - ? "bg-purple-100 text-purple-800" |
26 | | - : event.modality === "Virtual" |
27 | | - ? "bg-green-100 text-green-800" |
28 | | - : "bg-blue-100 text-blue-800" |
29 | | - }`} |
30 | | - > |
31 | | - {event.modality} |
32 | | - </span> |
33 | | - </div> |
34 | | - </div> |
35 | | - <div class="p-6"> |
36 | | - <div class="flex justify-between items-start mb-3"> |
37 | | - <h2 class="text-xl font-bold text-gray-800">{event.title}</h2> |
38 | | - </div> |
39 | | - <p class="text-gray-600 mb-4 line-clamp-2">{event.description}</p> |
40 | | - <div class="space-y-2 text-sm text-gray-500"> |
41 | | - <div class="flex items-center gap-2"> |
42 | | - <svg |
43 | | - class="w-4 h-4" |
44 | | - fill="none" |
45 | | - stroke="currentColor" |
46 | | - viewBox="0 0 24 24" |
47 | | - > |
48 | | - <path |
49 | | - stroke-linecap="round" |
50 | | - stroke-linejoin="round" |
51 | | - stroke-width="2" |
52 | | - d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" |
53 | | - /> |
54 | | - </svg> |
55 | | - <span> |
56 | | - {new Date(event.date).toLocaleDateString("en-US", { |
57 | | - weekday: "long", |
58 | | - year: "numeric", |
59 | | - month: "long", |
60 | | - day: "numeric", |
61 | | - })} |
62 | | - </span> |
63 | | - </div> |
64 | | - <div class="flex items-center gap-2"> |
65 | | - <svg |
66 | | - class="w-4 h-4" |
67 | | - fill="none" |
68 | | - stroke="currentColor" |
69 | | - viewBox="0 0 24 24" |
70 | | - > |
71 | | - <path |
72 | | - stroke-linecap="round" |
73 | | - stroke-linejoin="round" |
74 | | - stroke-width="2" |
75 | | - d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" |
76 | | - /> |
77 | | - <path |
78 | | - stroke-linecap="round" |
79 | | - stroke-linejoin="round" |
80 | | - stroke-width="2" |
81 | | - d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" |
82 | | - /> |
83 | | - </svg> |
84 | | - <span>{event.place}</span> |
85 | | - </div> |
86 | | - <div class="flex items-center gap-2"> |
87 | | - <svg |
88 | | - class="w-4 h-4" |
89 | | - fill="none" |
90 | | - stroke="currentColor" |
91 | | - viewBox="0 0 24 24" |
92 | | - > |
93 | | - <path |
94 | | - stroke-linecap="round" |
95 | | - stroke-linejoin="round" |
96 | | - stroke-width="2" |
97 | | - d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" |
98 | | - /> |
99 | | - </svg> |
100 | | - <span>{event.attendees} attendees</span> |
101 | | - </div> |
102 | | - </div> |
103 | | - </div> |
104 | | - </div> |
| 13 | + events.map((event:Event, index) => ( |
| 14 | + <CardEvent {...event}/> |
105 | 15 | )) |
106 | 16 | } |
107 | 17 | </div> |
|
0 commit comments