28 lines
624 B
Plaintext
28 lines
624 B
Plaintext
---
|
|
import { Image } from "@astrojs/image/components";
|
|
import { getContentArray } from "../utils/helpers";
|
|
import { getImageSrc } from "../utils/payload";
|
|
const { content } = Astro.props;
|
|
const contentArray = getContentArray(content);
|
|
---
|
|
|
|
<div>
|
|
{
|
|
contentArray.map((value) => {
|
|
if (typeof value === "string") {
|
|
return <article set:html={value} />;
|
|
} else {
|
|
return (
|
|
<Image
|
|
src={getImageSrc(value.src)}
|
|
width={value.width}
|
|
height={value.height}
|
|
format="webp"
|
|
alt="hallo"
|
|
/>
|
|
);
|
|
}
|
|
})
|
|
}
|
|
</div>
|