diff --git a/src/components/ScalingIframe/index.tsx b/src/components/ScalingIframe/index.tsx index 1d79b66c25..e2e55c9d1a 100644 --- a/src/components/ScalingIframe/index.tsx +++ b/src/components/ScalingIframe/index.tsx @@ -9,6 +9,8 @@ export const ScalingIframe = ({ }) => { const iframeRef = useRef(null); const [scale, setScale] = useState(1); + const [error, setError] = useState(false); + useLayoutEffect(() => { const fitToParent = () => { const iframe = iframeRef.current; @@ -24,10 +26,56 @@ export const ScalingIframe = ({ return () => window.removeEventListener("resize", fitToParent); }, [width]); + const handleError = () => { + setError(true); + }; + + if (error) { + return ( +
+
+

Unable to load embedded content

+

+ Please visit{" "} + + the original sketch + + {" "}on OpenProcessing +

+
+
+ ); + } + return (