41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import Image from "@/components/Image"
|
|
|
|
import Card from ".."
|
|
|
|
import styles from "./cardImage.module.css"
|
|
|
|
import type { CardImageProps } from "@/types/components/cardImage"
|
|
|
|
export default function CardImage({
|
|
card,
|
|
imageCards,
|
|
className,
|
|
}: CardImageProps) {
|
|
return (
|
|
<article className={`${styles.container} ${className}`}>
|
|
<div className={styles.imageContainer}>
|
|
{imageCards.map(
|
|
({ backgroundImage }, idx: Number) =>
|
|
backgroundImage && (
|
|
<Image
|
|
key={
|
|
(backgroundImage.title &&
|
|
`${backgroundImage.title}-${idx}`) ||
|
|
(backgroundImage.meta.caption &&
|
|
`${backgroundImage.meta.caption}-${idx}`) ||
|
|
backgroundImage.url
|
|
}
|
|
src={backgroundImage.url}
|
|
className={styles.image}
|
|
alt={backgroundImage.title}
|
|
width={180}
|
|
height={180}
|
|
/>
|
|
)
|
|
)}
|
|
</div>
|
|
<Card {...card} className={styles.card} />
|
|
</article>
|
|
)
|
|
}
|