import Link from 'next/link'; interface VisaCountriesProps { data: { heading: string; subheading: string; description: string; countries: { name: string; code: string; flag: string; link: string; visaTypes: string[]; }[]; ctaButton: { label: string; href: string; }; }; } const VisaCountries = ({ data }: VisaCountriesProps) => { // Display the first country as featured const featuredCountry = data.countries[0]; const halfLength = Math.ceil(featuredCountry.visaTypes.length / 2); const firstColumn = featuredCountry.visaTypes.slice(0, halfLength); const secondColumn = featuredCountry.visaTypes.slice(halfLength); return (
{data.subheading}

{data.heading}

{data.description}

    {firstColumn.map((visaType, index) => (
  • {visaType}
  • ))}
    {secondColumn.map((visaType, index) => (
  • {visaType}
  • ))}
{data.ctaButton.label}
img
{featuredCountry.code}.{featuredCountry.name}
); }; export default VisaCountries;