import SectionContainer from "@/components/Section/Container"
import Header from "@/components/Section/Header"
import Card from "@/components/TempDesignSystem/Card"
import Grids from "@/components/TempDesignSystem/Grids"

import { CardsGridProps } from "@/types/components/loyalty/blocks"

export default function CardsGrid({ cards_grid }: CardsGridProps) {
  return (
    <SectionContainer>
      <Header title={cards_grid.title} subtitle={cards_grid.preamble} />
      <Grids.Stackable>
        {cards_grid.cards.map((card) => (
          <Card
            theme={cards_grid.theme || "one"}
            key={card.system.uid}
            scriptedTopTitle={card.scripted_top_title}
            heading={card.heading}
            bodyText={card.body_text}
            secondaryButton={card.secondaryButton}
            primaryButton={card.primaryButton}
          />
        ))}
      </Grids.Stackable>
    </SectionContainer>
  )
}
