feat: add image preprocessor component

This commit is contained in:
Thomas Bishop 2025-08-14 16:31:25 +01:00
parent 923b7309ba
commit f22f380b96

View file

@ -24,6 +24,12 @@ const EntryLoadingSkeleton = () => {
) )
} }
const ImagePreprocessor = (src) => {
const filename = src.src.split("/").pop()
const s3RootUrl = "https://eolas.s3.systemsobscure.net/"
return <img src={s3RootUrl + filename} />
}
export default function EntryBody({ body, isLoading }) { export default function EntryBody({ body, isLoading }) {
if (isLoading) { if (isLoading) {
return <EntryLoadingSkeleton /> return <EntryLoadingSkeleton />
@ -88,6 +94,7 @@ export default function EntryBody({ body, isLoading }) {
{children} {children}
</code> </code>
), ),
img: ({ children, src }) => <ImagePreprocessor src={src} />,
}} }}
> >
{body} {body}