import Image from "next/image";
import type { Integration } from "@/static/integrations";

type IntegrationCardProps = {
  integration: Integration;
};

const IntegrationCard = ({ integration }: IntegrationCardProps) => {
  return (
    <article className="flex h-full flex-col rounded-2xl border border-[#E8E8EE] bg-white p-5 sm:p-6">
      <div className="flex items-center gap-3">
        <span
          className="flex size-10 shrink-0 items-center justify-center rounded-xl sm:size-11"
          style={{ backgroundColor: integration.accent }}
        >
          <Image
            src={integration.logo}
            alt=""
            width={28}
            height={28}
            className="size-6 object-contain sm:size-7"
          />
        </span>
        <h3 className="text-base font-bold text-ink sm:text-lg">
          {integration.name}
        </h3>
      </div>

      <p className="mt-3 flex-1 text-sm leading-relaxed text-muted sm:mt-4 sm:text-base">
        {integration.description}
      </p>

      <p className="mt-4 text-sm text-[#9CA3AF] sm:mt-5">
        {integration.category}
      </p>
    </article>
  );
};

export default IntegrationCard;
