2023-06-17 12:24:56 +02:00

28 lines
622 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>