-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.tsx
More file actions
59 lines (54 loc) · 2.15 KB
/
page.tsx
File metadata and controls
59 lines (54 loc) · 2.15 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
52
53
54
55
56
57
58
59
'use client'
import { FullScreenError } from '@/components/FullScreenError'
import { FullScreenLoading } from '@/components/FullScreenLoading'
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '@/components/ui/card'
import { useEvent } from '@/hooks/useEvent'
export default function EventsPage() {
const { data, loading, error } = useEvent()
if (loading) return <FullScreenLoading />
if (error) return <FullScreenError error={error} />
if (!data || data.length === 0)
return <FullScreenError error="Nenhum evento encontrado." />
return (
<div className="space-y-6">
<div className="flex flex-col md:flex-row justify-between items-center mb-6">
<div className="title-container">
<h1 className="title">Eventos</h1>
<p className="text-muted-foreground">
Confira os eventos e atividades futuras.
</p>
</div>
{/* TODO implement search field */}
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
{data.map((event) => (
<Card key={event.id}>
<CardHeader>
<CardTitle className="text-xl">
{event.title}
</CardTitle>
<CardDescription>
De {event.start_date} até {event.end_date}
</CardDescription>
</CardHeader>
<CardContent className="space-y-2">
<p className="font-medium text-sm">
<span className="text-muted-foreground">
Local:
</span>{' '}
{event.location}
</p>
<p className="text-sm">{event.description}</p>
</CardContent>
</Card>
))}
</div>
</div>
)
}