@udus/notion-renderer
Version:

15 lines (14 loc) • 1.06 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { RichText } from "../RichText/RichText.js";
export const Video = ({ block }) => {
const videoUrl = block.video.type == "external"
? block.video.external.url
: block.video.type == "file"
? block.video.file.url
: "";
return (_jsx("div", { id: block.id, className: "notion-block notion-video", children: block.video.type == "external" && block.video.oembed ? (_jsx("div", { dangerouslySetInnerHTML: {
__html: block.video.oembed.type === "video"
? block.video.oembed.html
: "",
} })) : (_jsxs(_Fragment, { children: [_jsxs("video", { controls: true, src: videoUrl, children: ["Your browser does not support type os. You can download video file", " ", _jsx("a", { href: videoUrl, children: "here" }), "."] }), _jsx("div", { className: "notion-caption notion-video-caption", children: _jsx(RichText, { richText: block.video.caption }) })] })) }));
};