-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholdhomepage.text
80 lines (69 loc) · 2.39 KB
/
oldhomepage.text
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import CategoryFilter from "@/components/shared/CategoryFilter";
import Collection from "@/components/shared/Collection";
import Search from "@/components/shared/Search";
import { Button } from "@/components/ui/button";
import { getAllEvents } from "@/lib/actions/event.actions";
import { SearchParamProps } from "@/types";
import Image from "next/image";
import Link from "next/link";
export default async function Home({searchParams}:SearchParamProps) {
const page = Number(searchParams?.page) || 1;
const searchText = (searchParams?.query as string) || "";
const category = (searchParams?.category as string) || "";
const events = await getAllEvents({
query: searchText,
category: category,
page: page,
limit: 6,
});
console.log(events);
return (
<>
<section className="bg-primary-50 bg-dotted-pattern bg-contain py-5 md:py-10">
<div className="wrapper grid grid-cols-1 gap-5 md:grid-cols-2 2xl:gap-0">
<div className="flex flex-col justify-center gap-8">
<h1 className="h1-bold">
Code, Connect, Celebrate: Your Scripts, Our Platform!
</h1>
<p className="p-regular-20 md:p-regular-24">
Unlock valuable insights from 3,168+ mentors at world-class
companies within our global community. Book and elevate your
learning journey with us.
</p>
<Button size="lg" asChild className="button w-full sm:w-fit">
<Link href="#events">Explore Now</Link>
</Button>
</div>
<Image
src="/assets/images/hero.png"
alt="hero"
width={1000}
height={1000}
className="max-h-[70vh] object-contain object-center 2xl:max-h-[50vh]"
/>
</div>
</section>
<section
id="events"
className="wrapper my-8 flex flex-col gap-8 md:gap-12"
>
<h2 className="h2-bold">
Trusted by <br /> Thousands of Events
</h2>
<div className="">
<Search />
<CategoryFilter />
</div>
<Collection
data={events?.data}
emptyTitle="No Events found"
emptyStateSubtext="No events found. Please try another search term."
collectionType="All_Events"
limit={6}
page={1}
totalPages={2}
/>
</section>
</>
);
}