-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathpage.tsx
156 lines (141 loc) · 4.83 KB
/
page.tsx
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
'use client';
import React from 'react';
import { Divider } from '@/components/ui';
import { useForumData } from '@/context/ForumDataContext';
import { renderContent } from '@/utils/quillUtils';
import PaginatedSection from '@/views/cleanairforum/PaginatedSection';
const Page = () => {
const data = useForumData();
if (!data) {
return null;
}
// Filter Co-Convening Partners
const conveningPartners = data.partners
?.filter((partner: any) => partner.category === 'Co-Convening Partner')
.map((partner: any) => ({
id: partner.id,
logoUrl: partner.partner_logo_url,
}));
// Filter Host Partners
const hostPartners = data.partners
?.filter((partner: any) => partner.category === 'Host Partner')
.map((partner: any) => ({
id: partner.id,
logoUrl: partner.partner_logo_url,
}));
const sponsorPartner = data.partners
?.filter((partner: any) => partner.category === 'Sponsor Partner')
.map((partner: any) => ({
id: partner.id,
logoUrl: partner.partner_logo_url,
}));
// Filter Funding Partners (if available)
const fundingPartners = data.partners
?.filter((partner: any) => partner.category === 'Funding Partner')
.map((partner: any) => ({
id: partner.id,
logoUrl: partner.partner_logo_url,
}));
return (
<div className="px-4 lg:px-0 flex flex-col gap-6">
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
{/* Partners Text Section */}
<div className="py-4">
<h2 className="text-2xl font-bold">Partners</h2>
<div
dangerouslySetInnerHTML={{
__html: renderContent(data.partners_text_section),
}}
/>
</div>
{/* Sponsorship Opportunities Text Section */}
<div className="py-4">
<h2 className="text-2xl font-bold">Sponsorship opportunities</h2>
<div
dangerouslySetInnerHTML={{
__html: renderContent(data.sponsorship_opportunities_partners),
}}
/>
</div>
{/* Convening Partners Section */}
{conveningPartners?.length > 0 && (
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
<div>
<div className="flex flex-col md:flex-row md:space-x-8">
<div className="md:w-1/3 mb-4 md:mb-0">
<h2 className="text-2xl font-bold text-gray-900">
Convening partners
</h2>
</div>
<PaginatedSection
noClick={true}
logos={conveningPartners}
sectionClassName="grid grid-cols-1 lg:grid-cols-2 w-full"
/>
</div>
</div>
</>
)}
{/* Host Partners Section */}
{hostPartners?.length > 0 && (
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
<div>
<div className="flex flex-col md:flex-row md:space-x-8">
<div className="md:w-1/3 mb-4 md:mb-0">
<h2 className="text-2xl font-bold text-gray-900">
Host partners
</h2>
</div>
<PaginatedSection
noClick={true}
logos={hostPartners}
sectionClassName="grid grid-cols-1 lg:grid-cols-2 w-full"
/>
</div>
</div>
</>
)}
{/* Sponsors Section */}
{sponsorPartner?.length > 0 && (
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
<div>
<div className="flex flex-col md:flex-row md:space-x-8">
<div className="md:w-1/3 mb-4 md:mb-0">
<h2 className="text-2xl font-bold text-gray-900">Sponsors</h2>
</div>
<PaginatedSection
noClick={true}
logos={sponsorPartner}
sectionClassName="grid grid-cols-1 lg:grid-cols-2 w-full"
/>
</div>
</div>
</>
)}
{/* Funding Partners Section */}
{fundingPartners?.length > 0 && (
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
<div>
<div className="flex flex-col md:flex-row md:space-x-8">
<div className="md:w-1/3 mb-4 md:mb-0">
<h2 className="text-2xl font-bold text-gray-900">
Funding partners
</h2>
</div>
<PaginatedSection
noClick={true}
logos={fundingPartners}
sectionClassName="grid grid-cols-1 lg:grid-cols-2 w-full"
/>
</div>
</div>
</>
)}
</div>
);
};
export default Page;