"use client";
import { Autoplay, Pagination } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/react";
import Link from "next/link";
import "swiper/css";
import "swiper/css/pagination";

export default function Hero() {
  const swiperOptions = {
    slidesPerView: 1,
    loop: true,
    speed: 4000,
    freeMode: true,
    autoplay: {
      delay: 0,
      disableOnInteraction: false,
    },
    pagination: {
      el: ".swiper-pagination",
      clickable: true,
    },
    modules: [Autoplay, Pagination],
  };

  const slides = [
    {
      id: 1,
      image: "/assets/img/cta-bg.jpg",
      title: "Create the building",
      subtitle: "you want here",
      text: "Proactively pontificate client-centered relationships visavis process centric leadership skills. Credibly.",
    },
    {
      id: 2,
      image: "/assets/img/cta-bg.jpg",
      title: "Design your dream",
      subtitle: "with us today",
      text: "Empower your projects with innovative solutions and expert guidance from start to finish.",
    },
    {
      id: 3,
      image: "/assets/img/cta-bg.jpg",
      title: "Build your future",
      subtitle: "with confidence",
      text: "Delivering excellence through teamwork, integrity, and cutting-edge technology. Credibly",
    },
  ];

  return (
    <Swiper {...swiperOptions} className="hero-swiper">
      {slides.map((slide) => (
        <SwiperSlide key={slide.id}>
          <section
            className="hero-section hero-1"
            style={{ backgroundImage: `url(${slide.image})` }}
          >
            <div className="container-fluid">
              <div className="row">
                <div className="col-lg-12">
                  <div className="hero-content">
                    <h1 className="splt-txt">
                      <span className="break-line">{slide.title}</span>
                      <span className="break-line">{slide.subtitle}</span>
                    </h1>
                    <p>{slide.text}</p>
                    <div className="hero-button">
                      <Link href="/about" className="theme-btn bg-white">
                        Explore More
                        <i className="fa-regular fa-arrow-right"></i>
                      </Link>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>
        </SwiperSlide>
      ))}
      <div className="swiper-pagination"></div>
    </Swiper>
  );
}
