ba.js
5.79 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import PageBanner from "@/components/reuseables/PageBanner";
import React from "react";
import Clientele from "@/components/reuseables/Clientele";
import qs from "qs";
import axios from "axios";
import MethodTwoSection from "@/components/reuseables/services/MethodTwo";
import MethodOne from "@/components/reuseables/services/MethodOne";
import Seo from "@/components/reuseables/Seo/Seo";
import LeftSideImage from "@/container/Corpedia/LeftSideImage";
import RightSideImage from "@/container/Corpedia/RightSideImage";
import ConversionCode from "@/components/reuseables/ConversionCode/ConversionCode";
const banners = [
{
imageSrc: "/images/banner/business_advisory.webp ",
pageTitle: "Business Advisory ",
homePageUrl: "/client-servicing",
homePageText: "Client Servicing",
activePageText: "Business Advisory ",
},
// Add more banners as needed
];
const sliderConfig = {
spaceBetween: 20,
slidesPerView: 5,
showPagination: true,
showAutoplay: true,
autoplayDelay: 4000,
};
const Ba = ({ bapage ,conversionData }) => {
const dynamicdata = bapage?.BusinessDetails;
// console.log("dynamicdata", dynamicdata);
const clientlogo = bapage?.Clientel;
// console.log("clientlogo", clientlogo);
const seo = bapage?.seo;
// console.log(seo);
const code = conversionData?.conversion;
return (
<>
<Seo seo={seo} />
<ConversionCode code={code} />
<PageBanner banners={banners} />
<section className="cfo-page">
{dynamicdata &&
dynamicdata?.map((section, index) => {
// console.log("section", section);
switch (section.__component) {
case "dynamic-zone.about":
return (
<LeftSideImage
title={section?.Title}
subtitle={section?.Subtitle}
image={section?.Image}
content={section?.Content}
/>
);
case "dynamic-zone.background":
return (
<RightSideImage
title={section?.Title}
subtitle={section?.Subtitle}
image={section?.Image}
content={section?.Content}
/>
);
case "dynamic-zone.element-one":
return (
<MethodOne
heading={section?.Heading}
data={section?.ElementList}
/>
);
case "dynamic-zone.element-two":
return (
<MethodTwoSection
heading={section?.Heading}
data={section?.ElementList}
/>
);
default:
return null;
}
})}
</section>
{/* <div className="cfo-services-area pt-100 ">
<Container>
{BAData.map((item, index) => (
<ContentSection
key={item.id}
subtitle={item.subtitle}
title={item.title}
paragraphs={item.paragraphs}
imageSrc={item.imageSrc}
imageAlt={item.imageAlt}
reverse={index % 2 !== 0}
/>
))}
</Container>
</div>
<div className="cfo-services-area ptb-100 bg-light">
<Container>
{aboutcfo.map((item, index) => (
<ContentSection
key={item.id}
subtitle={item.subtitle}
title={item.title}
paragraphs={item.paragraphs}
imageSrc={item.imageSrc}
imageAlt={item.imageAlt}
reverse={index % 2 !== 1}
/>
))}
</Container>
</div>
<div className="cfo-services-area ptb-100">
<Container>
{shareholders.map((item, index) => (
<ContentSection
key={item.id}
subtitle={item.subtitle}
title={item.title}
paragraphs={item.paragraphs}
imageSrc={item.imageSrc}
imageAlt={item.imageAlt}
reverse={index % 2 !== 0}
/>
))}
</Container>
</div>
<MethodOne
data={MethodOneData}
sectionTitle="Methodology 2 - Nature of Engagements"
heading="Elements in CFO Services"
descrption="Here are some key activities we focus on in our CFO services."
sliderConfig={sliderConfig} // Pass the slider configuration here
/> */}
<div className="ptb-100">
<Clientele partners={clientlogo} />
</div>
</>
);
};
export default Ba;
export async function getServerSideProps() {
try {
const query1 = {
populate: [
"Banner.Image",
"BusinessDetails",
"BusinessDetails.Image",
"BusinessDetails.Heading",
"BusinessDetails.ElementList.StepImg",
"Clientel.logos",
"seo",
"seo.metaImage",
"seo.schema",
],
};
const query2 = {
populate: ["conversion"],
};
const query1String = qs.stringify(query1, {
encodeValuesOnly: true,
});
const query12String = qs.stringify(query2, {
encodeValuesOnly: true,
});
const endpoint1 = `${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/business-page?${query1String}`;
const endpoint2 = `${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/google-manger?${query12String}`;
// console.log(`Final url: ${endpoint1}`);
const [response1, response2] = await Promise.all([
axios.get(endpoint1),
axios.get(endpoint2),
]);
const bapage = response1.data.data;
const conversionData = response2.data.data;
return {
props: { bapage , conversionData },
};
} catch (error) {
console.log("Error", error);
}
}