import Image, { StaticImageData } from "next/image";
import { InteractiveContainer } from "@/app/components/InteractiveContainer";
import Link from "next/link";
import { CheckIcon } from "lucide-react";
import { Container } from "@/app/components/layout/Container";
import { exportImgsData } from "../_data/home-data";
import avatarImg from "../_assets/customer-testimonial-avatar.png";
import Heading from "@/app/components/ui/Heading";

function ExportImg({
  alt,
  className,
  src,
}: {
  alt: string;
  className: string;
  src: StaticImageData;
}) {
  return (
    <Image
      src={src}
      alt={alt}
      placeholder="blur"
      className={`${className} object-cover w-full h-auto`}
    />
  );
}

function ListItem({
  bgColor,
  title,
  iconColor,
}: {
  bgColor: string;
  title: string;
  iconColor: string;
}) {
  return (
    <li className="flex items-center gap-3">
      <div className={`rounded-full p-1 ${bgColor}`}>
        <CheckIcon size={14} className={iconColor} />
      </div>
      <p className="text-primary text-lg font-medium">{title}</p>
    </li>
  );
}

export function RiceExport() {
  return (
    <section className="flex mt-40 justify-center">
      <Container>
        <div className="w-full flex flex-col-reverse lg:flex-row gap-24 lg:gap-10">
          <InteractiveContainer
            step={6}
            boundry={24}
            className="grid grid-cols-3 gap-5 w-full lg:w-1/2"
          >
            <>
              {exportImgsData.map((img, index) => (
                <ExportImg
                  alt={img.alt}
                  src={img.src}
                  className="rounded-xl"
                  key={index}
                />
              ))}
            </>
          </InteractiveContainer>
          <div className="w-full lg:w-1/2 flex flex-col gap-7">
            <p className="text-primary text-sm font-medium">
              From Sourcing to Delivery
            </p>
            <Heading as="h2" variant="subsection" className="text-primary">
              Rice Exports at Your Doorstep
            </Heading>
            <p className="text-gray-600 ">
              We distinguish ourselves as one of the top basmati exporter of
              Pakistan. Our extensive international market reflects our
              commitment to fulfilling diverse customers.
            </p>
            <div className="flex gap-4 lg:gap-8">
              <ul className="flex flex-col gap-3">
                <ListItem
                  title="Customer Demand"
                  bgColor="bg-blue-200/50"
                  iconColor="text-slate-500"
                />
                <ListItem
                  title="Sample Dispatch"
                  bgColor="bg-blue-200/50"
                  iconColor="text-slate-500"
                />
                <ListItem
                  title="Freight Cost Calculation"
                  bgColor="bg-blue-200/50"
                  iconColor="text-slate-500"
                />
              </ul>
              <ul className="flex flex-col gap-3">
                <ListItem
                  title="Customer Demand"
                  bgColor="bg-amber-200/50"
                  iconColor="text-amber-600"
                />
                <ListItem
                  title="Sample Dispatch"
                  bgColor="bg-amber-200/50"
                  iconColor="text-amber-600"
                />
                <ListItem
                  title="Freight Cost Calculation"
                  bgColor="bg-amber-200/50"
                  iconColor="text-amber-600"
                />
              </ul>
            </div>
            <div className="border border-gray-100" />
            <div className="flex gap-2 lg:gap-6">
              <Link
                href="/contact"
                className="block w-fit rounded-full text-white font-medium bg-accent px-6 py-3 hover:bg-primary transition-all duration-500"
              >
                Explore More
              </Link>
              <div className="border border-gray-100" />
              <div className="flex gap-4">
                <Image
                  src={avatarImg}
                  alt="Founder and CEO customer support contact avatar"
                  placeholder="blur"
                  className="rounded-full w-12 h-12 object-cover"
                />
                <div>
                  <p className="text-gray-600 font-semibold">Or Call Us</p>
                  <Link
                    href="tel:+923111557744"
                    className="text-primary font-semibold"
                  >
                    +923111557744
                  </Link>
                </div>
              </div>
            </div>
          </div>
        </div>
      </Container>
    </section>
  );
}
