@udus/notion-renderer
Version:

15 lines (14 loc) • 489 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
export const Cover = ({ cover }) => {
if (!cover) {
return null;
}
if (cover.type === "external") {
return (_jsx("img", { className: "notion-cover", src: cover.external.url, alt: "notion cover" }));
}
else if (cover.type === "file") {
return (_jsx("img", { className: "notion-cover", src: cover.file.url, alt: "notion cover" }));
}
console.warn("unknown cover type");
return null;
};