feat(WEB-112): adjust current-blocks-page to new model
This commit is contained in:
42
components/Current/Aside/Puff/index.tsx
Normal file
42
components/Current/Aside/Puff/index.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { renderOptions } from "./renderOptions"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
|
||||
import styles from "./puff.module.css"
|
||||
|
||||
import type { PuffProps } from "@/types/components/current/asides/puff"
|
||||
|
||||
export default function Puff({
|
||||
imageConnection,
|
||||
link,
|
||||
text,
|
||||
title,
|
||||
}: PuffProps) {
|
||||
return (
|
||||
<a className={styles.link} href={link.href}>
|
||||
<article>
|
||||
{imageConnection.edges.map((image) => (
|
||||
<Image
|
||||
alt={image.node.title}
|
||||
className={styles.image}
|
||||
height={image.node.dimension.height}
|
||||
key={image.node.system.uid}
|
||||
src={image.node.url}
|
||||
width={image.node.dimension.width}
|
||||
/>
|
||||
))}
|
||||
<section className={styles.content}>
|
||||
<header>
|
||||
<h3 className={styles.heading}>{title}</h3>
|
||||
</header>
|
||||
<JsonToHtml
|
||||
embeds={[]}
|
||||
nodes={text.json.children}
|
||||
renderOptions={renderOptions}
|
||||
/>
|
||||
</section>
|
||||
</article>
|
||||
</a>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user