kios-webapp/astro/src/components/RichText.astro
Max Schmidt d8c1f15c91 HS
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
2023-05-15 17:38:17 +02:00

27 lines
594 B
Plaintext

---
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 <article set:html={value} />;
} else {
return (
<Image
src={`http://payload:3001/media/${value.src}`}
width={value.width}
height={value.height}
format="webp"
alt="hallo"
/>
);
}
})
}
</div>