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

interface IChallengesSection {
    content: {
        title: string,
        subTitle?: string,
        challenges: {
            problem: string,
            problemDescription: string,
            sollution: string,
            sollutionDescription: string,
        }[]
    }
}

const ChallengesSection = ({ content }: IChallengesSection) => {
    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="flex flex-col gap-12 lg:gap-6 ">
                
                {
                    content.challenges.map((challenge, index) => (
                        <ChallengeCard key={index} challenge={challenge} />
                    ))
                }
            </ul>
        </div>
    )
}

export default ChallengesSection
