Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt
2023-05-15 17:11:32 +02:00
parent 7a57a69259
commit acda6ea8c0
4 changed files with 78 additions and 76 deletions

View File

@ -0,0 +1,26 @@
---
import { Image } from "@astrojs/image/components";
import { getContentArray } from "../utils/helpers";
const { content } = Astro.props;
const contentArray = getContentArray(content);
---
<div>
{
contentArray.map((value) => {
if (typeof value === "string") {
return <div set:html={value} />;
} else {
return (
<Image
src={`http://payload:3001/media/${value.src}`}
width={value.width}
height={value.height}
format="webp"
alt="hallo"
/>
);
}
})
}
</div>