feat: add image preprocessor component
This commit is contained in:
parent
923b7309ba
commit
f22f380b96
1 changed files with 7 additions and 0 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue