import React from "react"; import Breadcrumb from "../../components/Breadcrumb"; import { type VisaCountry } from "@/api/visa"; interface VisaDetailProps { country: VisaCountry; } export default function VisaDetail({ country }: VisaDetailProps) { const { name: rootName, detailedView } = country; const { activeCountry: countryData, relatedCountries, contactInfo, } = country.detailedView; return ( <> {/* Breadcrumb-Wrapper Section Start */} {/* Country-details Section Start */} {/* Main Content */} {countryData.name} {countryData.description} {countryData.additionalInfo} {countryData.tagline} {/* Visa Types */} {/* Render mảng đầu tiên (index 0) */} {countryData.visaTypes?.[0] && ( {countryData.visaTypes[0].items.map( (item: any, itemIdx: number) => ( {item.title} {item.description} ), )} )} {/* Render mảng thứ hai (index 1) */} {countryData.visaTypes?.[1] && ( {countryData.visaTypes[1].items.map( (item: any, itemIdx: number) => ( {item.title} {item.description} ), )} )} {/* Visa Process */} {countryData.visaProcess && ( <> {countryData.visaProcess.title} {countryData.visaProcess.steps.map( (process: any, idx: number) => ( {process.number}. {process.title} {process.description} ), )} > )} {/* Gallery */} {countryData.gallery && countryData.gallery.length > 0 && ( {countryData.gallery.map( (image: string, idx: number) => ( ), )} )} {/* Visa Categories */} {countryData.visaCategories && ( <> {countryData.visaCategories.title} {countryData.visaCategories.steps.map( (subGroup: string[], groupIdx: number) => ( {subGroup.map((category: string, idx: number) => ( {category} ))} ), )} > )} {/* Service Options */} {countryData.visaService && ( <> {countryData.visaService.title} {countryData.visaService.steps.map( (process: any, idx: number) => ( {process.number}. {process.title} - {process.description} ), )} > )} {/* Sidebar */} {relatedCountries.map((relCountry: any, idx: number) => ( {relCountry.name} ))} {/* Contact Box */} {contactInfo && ( {contactInfo.sectionTitle} {contactInfo.helpText} {/* Phone */} {contactInfo.phone.label}: {contactInfo.phone.value} {/* Email */} {contactInfo.email.label}: {contactInfo.email.value} {/* Location */} {contactInfo.location.label}: {contactInfo.location.address} )} > ); }
{countryData.description}
{countryData.additionalInfo}
{item.description}
{contactInfo.helpText}