UNPKG

@udus/notion-renderer

Version:
10 lines (9 loc) 668 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { RichText } from "../RichText/RichText.js"; export const Image = ({ block }) => { return (_jsxs("div", { id: block.id, className: "notion-block notion-image", children: [_jsx("img", { src: block.image.type == "external" ? block.image.external.url : block.image.type == "file" ? block.image.file.url : "", alt: block.image.caption.map((b) => b.plain_text).join("") }), _jsx("div", { className: "notion-caption notion-image-caption", children: _jsx(RichText, { richText: block.image.caption }) })] })); };