import type { ComponentType } from "react";
import type { IconProps } from "@/components/icons";
import { IconBadge } from "@/components/shared/icon-badge";

type WhyUsItemProps = { icon: ComponentType<IconProps>; title: string; description: string };

export function WhyUsItem({ icon: Icon, title, description }: WhyUsItemProps) {
  return (
    // Phone & tablet (Figma 390 / 744): tighter — 8px gaps, 14px title, 12px light text.
    <li className="flex flex-col gap-5 max-lg:gap-2">
      <IconBadge>
        <Icon />
      </IconBadge>
      <h3 className="font-heading text-base leading-6 font-bold text-heading max-lg:text-sm max-lg:leading-6">{title}</h3>
      {/* Figma: the text box is 14px wider than its column (304 vs 290), so it wraps later — but never past the screen. */}
      <p className="max-w-[304px] text-sm leading-[22.75px] text-subtle max-lg:-me-3.5 max-lg:max-w-none max-lg:text-xs max-lg:text-soft">{description}</p>
    </li>
  );
}
