import { HTMLAttributes, useEffect, useRef } from 'react'; interface Props extends HTMLAttributes { src: string; } const EmbedViewer = (props: Props) => { const containerRef = useRef(null); useEffect(() => { if (!containerRef.current) return; const iframe = containerRef.current.querySelector('iframe'); if (iframe) { iframe.style.width = '100%'; iframe.style.height = '100%'; iframe.style.border = 'none'; } }, [props.src]); return (
); }; export default EmbedViewer;