import { fetchServicePageData, fetchCountries } from "../../api/servicesApi"; import { imageUrl } from "../utils/image"; import Breadcrumb from "../components/Breadcrumb"; import ImageWithFallback from "../components/ImageWithFallback"; import "./services.css"; export default async function ServicesPage() { const data = await fetchServicePageData(); const allCountries = await fetchCountries(); const { services, destinations, visas, reviews } = data; // Pagination logic - show only first 5 countries const COUNTRIES_PER_PAGE = 5; const displayedCountries = allCountries.slice(0, COUNTRIES_PER_PAGE); const hasMoreCountries = allCountries.length > COUNTRIES_PER_PAGE; return ( <> {/* Breadcrumb Section */} {/* Service Section Start */} {services.title.subTitle} {services.title.mainTitle} {services.items.map((service: any) => ( {service.layout === "right" && ( read more )} {service.layout === "left" && ( )} {service.name} {service.description} {service.layout === "right" && ( )} {service.layout === "left" && ( read more )} ))} {/* Destination-Offer Section Start */} {destinations.title.subTitle} {destinations.title.mainTitle} {displayedCountries.map((country: any) => ( {country.name} {country.services && country.services.length > 0 ? `Services: ${country.services.slice(0, 2).join(", ")}${country.services.length > 2 ? "..." : ""}` : "Immigration services available"} ))} {/* Show "View More" button if there are more countries */} {hasMoreCountries && ( View All Countries ({allCountries.length}) )} {/* Service-Visa Section Start */} {/* {visas.items.map((visa: any, index: number) => ( 0 ? "style-2" : ""}`} > {visa.number} {visa.name} {visa.description} {visa.buttonText} ))} */} {/* Testimonial Section3 Start */} {reviews.title.subTitle} {reviews.title.mainTitle} View All Review {reviews.items.map((testimonial: any) => ( {[...Array(testimonial.rating)].map( (_: any, i: number) => ( ), )} "{testimonial.content}" {testimonial.author.name} {testimonial.author.type} ))} > ); }
{service.description}
{country.services && country.services.length > 0 ? `Services: ${country.services.slice(0, 2).join(", ")}${country.services.length > 2 ? "..." : ""}` : "Immigration services available"}
{visa.description}