import { H2, P,} from "@/components/ui/typography"
import { useTranslations } from "next-intl"
import { Button } from "@/components/ui/buttons/Button"
import WhyUsCard2 from "@/components/ui/cards/WhyUsCard2"

interface IWhyUsSection {
    content: {
        title?: string,
        subTitle?: string,
        features: {
            icon: React.ReactNode,
            title: string,
            description?: string
            link?: string
        }[]
        buttonTxt?: string
        link?: string
    }
    className?:string
    parentClassName?:string
}

const WhyUsSection = ({ content,className,parentClassName }: IWhyUsSection) => {
    const t = useTranslations()

    return (
        <div className=" flex flex-col gap-16 justify-center items-center">
            <div className="flex flex-col gap-2 text-center">
                <H2>{t(content.title)}</H2>
                {content.subTitle &&<P>{t(content.subTitle)}</P>}
            </div>
            <ul className={`grid grid-cols-1 lg:grid-cols-3 gap-y-16 gap-6 justify-center items-center text-center ${parentClassName}`}>
                {
                    content.features.map((feature, index) => (
                        <WhyUsCard2 key={index} feature={feature}   className={`${className ? className : ""}`} />
                    ))
                }
            </ul>
            {content.buttonTxt &&
                <Button link={content.link}>{t(content.buttonTxt)}</Button>
            }
        </div>
    )
}

export default WhyUsSection
