= props => {
);
default:
+ const unsupportedType = block?.value?.type || "unknown";
if (process.env.NODE_ENV !== "production") {
- console.log("Unsupported type " + block?.value?.type);
+ console.warn("Unsupported Notion block type: " + unsupportedType);
}
- return ;
+ return (
+
+ Unsupported Notion block type: {unsupportedType}
+
+ );
}
return null;
};
@@ -531,12 +535,14 @@ export const Block: React.FC = props => {
// Do not use custom component for base page block
level !== 0
) {
- const CustomComponent = customBlockComponents[blockValue?.type]!;
+ const CustomComponent = customBlockComponents[blockValue?.type]! as React.FC<
+ any
+ >;
return (
}
+ blockValue={blockValue}
level={level}
>
{children}
diff --git a/src/styles.css b/src/styles.css
index da0e210..387a733 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -197,6 +197,14 @@ img.notion-page-icon-offset {
.notion-small-text {
font-size: 14px;
}
+.notion-unsupported-block {
+ padding: 0.75em 1em;
+ border: 1px solid rgba(224, 62, 62, 0.35);
+ border-radius: 3px;
+ color: rgb(224, 62, 62);
+ background: rgb(251, 228, 228);
+ font-size: 0.875em;
+}
.notion-quote {
white-space: pre-wrap;
word-break: break-word;