import { getCmsImageUrl } from '@/utils/image';

interface PartnersProps {
    data: {
        visaConsultancy: {
            items: {
                name: string;
                icon: string;
                year: string;
            }[];
        };
        brands: {
            items: {
                logo: string;
            }[];
        };
    };
}

const Partners = ({ data }: PartnersProps) => {
    return (
        <>
            {/* Awards Section */}
            <section className="visa-consultency-section section-padding fix">
                <div className="container">
                    <div className="row g-4">
                        {(data.visaConsultancy?.items || []).map((partner, index) => (
                            <div key={index} className="col-xl-3 col-lg-4 col-md-6">
                                <div className="visa-consultency-item">
                                    <div className="image d-flex justify-content-center">
                                        <img src={getCmsImageUrl(partner.icon)} alt={partner.name} />
                                    </div>
                                    <h3>{partner.name}</h3>
                                    <h6>{partner.year}</h6>
                                </div>
                            </div>
                        ))}
                    </div>
                </div>
            </section>

            {/* Brand Partners Section */}
            <div className="brand-section fix">
                <div className="container">
                    <div className="brand-wrapper style-1">
                        <div className="brand-item">
                            <div className="swiper brand-slider">
                                <div className="swiper-wrapper">
                                    {(data.brands?.items || []).map((brand, index) => (
                                        <div key={index} className="swiper-slide">
                                            <div className="brand-image d-flex justify-content-center">
                                                <img src={getCmsImageUrl(brand.logo)} alt="brand-logo" />
                                            </div>
                                        </div>
                                    ))}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </>
    );
};

export default Partners;
