Files
web/packages/design-system/lib/components/ImageContainer/index.tsx
Bianca Widstam d9ec1b1f2d Merged in chore/BOOK-739-replace-caption (pull request #3428)
chore(BOOK-739): replace caption with typography

* chore(BOOK-739): replace caption with typography

* chore(BOOK-739): refactor div

* chore(BOOK-739): refactor badge

* chore(BOOK-739): remove span

* chore(BOOK-739): skeleton update

* chore(BOOK-739): update

* chore(BOOK-739): update reward

* chore(BOOK-739): update voucher currency


Approved-by: Erik Tiekstra
2026-01-14 09:33:27 +00:00

66 lines
1.5 KiB
TypeScript

import Image from "../Image"
import { Typography } from "../Typography"
import styles from "./imageContainer.module.css"
type Image = {
id: number
title: string
url: string
focalPoint: {
x: number
y: number
}
dimensions?: {
width: number
height: number
}
meta: {
alt?: string | null
caption?: string | null
}
}
type ImageContainerProps = {
leftImage: Image
rightImage: Image
}
export default function ImageContainer({
leftImage,
rightImage,
}: ImageContainerProps) {
return (
<section className={styles.container}>
<article>
<Image
className={styles.image}
src={leftImage.url}
height={365}
width={600}
alt={leftImage.meta.alt || leftImage.title}
focalPoint={leftImage.focalPoint}
dimensions={leftImage.dimensions}
/>
<Typography variant="Body/Supporting text (caption)/smRegular">
<p>{leftImage.meta.caption}</p>
</Typography>
</article>
<article>
<Image
className={styles.image}
src={rightImage.url}
height={365}
width={600}
alt={rightImage.meta.alt || rightImage.title}
focalPoint={rightImage.focalPoint}
dimensions={rightImage.dimensions}
/>
<Typography variant="Body/Supporting text (caption)/smRegular">
<p>{rightImage.meta.caption}</p>
</Typography>
</article>
</section>
)
}