()
| 5 | import { ArrowUpRight } from 'phosphor-react'; |
| 6 | |
| 7 | const ImageCardGrid: React.FC = () => { |
| 8 | // Destructure data from the JSON config |
| 9 | const { label, heading, problemsList } = ProblemsConfig; |
| 10 | |
| 11 | return ( |
| 12 | <div className="p-4"> |
| 13 | |
| 14 | {/* Grid Section */} |
| 15 | <div className="flex justify-center"> |
| 16 | <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-4 gap-y-6 max-w-5xl w-full"> |
| 17 | {problemsList.map((problem: any, index: number) => ( |
| 18 | <div |
| 19 | key={index} |
| 20 | className="w-full max-w-full flex flex-col items-center justify-center mx-auto" // Ensures consistent centering |
| 21 | > |
| 22 | |
| 23 | <ImageCard |
| 24 | imageSrc={problem.imageSrc} |
| 25 | imageAlt={problem.imageAlt} |
| 26 | title={problem.title} |
| 27 | description={problem.description} |
| 28 | > |
| 29 | {/* CTA Button */} |
| 30 | {problem.cta && ( |
| 31 | <button |
| 32 | onClick={() => |
| 33 | problem.cta.onClick |
| 34 | ? problem.cta.onClick() |
| 35 | : alert(problem.cta.text) |
| 36 | } |
| 37 | className="px-4 py-2 flex gap-1 text-sm font-normal items-center rounded-md bg-transparent text-foreground-hsl border border-border-color-primary/30" |
| 38 | > |
| 39 | {problem.cta.text} |
| 40 | <ArrowUpRight size={16}/> |
| 41 | </button> |
| 42 | )} |
| 43 | </ImageCard> |
| 44 | </div> |
| 45 | ))} |
| 46 | </div> |
| 47 | </div> |
| 48 | </div> |
| 49 | ); |
| 50 | }; |
| 51 | |
| 52 | export default ImageCardGrid; |
nothing calls this directly
no outgoing calls
no test coverage detected