kios-webapp/astro/src/components/Content.astro
Max Schmidt a3e58fecd6 asdf
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
2023-05-19 08:05:10 +02:00

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>