@udus/notion-renderer
Version:

15 lines (14 loc) • 923 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { RichText } from "../RichText/RichText.js";
export const Pdf = ({ block }) => {
const pdfUrl = block.pdf.type == "external"
? block.pdf.external.url
: block.pdf.type == "file"
? block.pdf.file.url
: "";
return (_jsxs("div", { id: block.id, className: "notion-block notion-pdf", children: [_jsxs("object", { type: "application/pdf", data: block.pdf.type == "external"
? block.pdf.external.url
: block.pdf.type == "file"
? block.pdf.file.url
: "", children: ["Your browser does not support pdfs. You can download pdf file", " ", _jsx("a", { href: pdfUrl, children: "here" }), "."] }), _jsx("div", { className: "notion-caption notion-pdf-caption", children: _jsx(RichText, { richText: block.pdf.caption }) })] }));
};