import { fetchServicePageData, fetchCountries } from "../../api/servicesApi"; import { imageUrl } from "../utils/image"; import Breadcrumb from "../components/Breadcrumb"; import ImageWithFallback from "../components/ImageWithFallback"; import "./services.css"; // Force dynamic rendering - khĂ´ng cache export const dynamic = 'force-dynamic'; 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" && ( )}
{service.layout === "left" && (
img
)}

{service.name}

{service.description}

{service.layout === "right" && (
img
)}
{service.layout === "left" && ( )}
))}
{/* Destination-Offer Section Start */}
img
{destinations.title.subTitle}

{destinations.title.mainTitle}

{displayedCountries.map((country: any) => (

{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
img
{reviews.items.map((testimonial: any) => (
{[...Array(testimonial.rating)].map( (_: any, i: number) => ( ), )}

"{testimonial.content}"

{testimonial.author.name}
{testimonial.author.type}
))}
); }