feat(SW-1383): Implement ContentCard for the Start Page * feat(SW-1383): Implement ContentCard - Add ContentCard component - Use within CarouselCards component * fix(SW-1383): adjust carousel and content card styling * refactor(SW-1383): optimize ContentCard component styling and props * feat(SW-1383): move ContentCard image check out of component * feat(SW-1383): Add optional link prop to ContentCard component * refactor(SW-1383): Make ContentCard component linkable Approved-by: Christian Andolf Approved-by: Erik Tiekstra
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import ContentCard from "@/components/ContentCard"
|
|
import SectionContainer from "@/components/Section/Container"
|
|
import SectionHeader from "@/components/Section/Header"
|
|
|
|
import styles from "./carouselCards.module.css"
|
|
|
|
import type { CarouselCardsProps } from "@/types/components/blocks/carouselCards"
|
|
|
|
export default function CarouselCards({ carousel_cards }: CarouselCardsProps) {
|
|
const {
|
|
heading,
|
|
enableFilters,
|
|
filterCategories,
|
|
cards,
|
|
defaultFilter,
|
|
link,
|
|
} = carousel_cards
|
|
|
|
return (
|
|
<SectionContainer>
|
|
<SectionHeader title={heading} link={link} />
|
|
{enableFilters && (
|
|
<details>
|
|
<summary>Filter data</summary>
|
|
<div>
|
|
{/* Filter component will go here */}
|
|
<pre className={styles.code}>
|
|
{JSON.stringify({ filterCategories, defaultFilter }, null, 2)}
|
|
</pre>
|
|
</div>
|
|
</details>
|
|
)}
|
|
{/* Carousel functionality will go here */}
|
|
<div className={styles.cardsContainer}>
|
|
{cards.map((card) => (
|
|
<ContentCard
|
|
link={card.link}
|
|
key={card.heading}
|
|
heading={card.heading}
|
|
bodyText={card.bodyText}
|
|
image={card.image}
|
|
promoText={card.promoText}
|
|
/>
|
|
))}
|
|
</div>
|
|
</SectionContainer>
|
|
)
|
|
}
|