lms/bootstrap/ssr/assets/embed-viewer-CRjXuKs5.js
2025-12-15 12:26:23 +01:00

28 lines
683 B
JavaScript

import { jsx } from "react/jsx-runtime";
import { useRef, useEffect } from "react";
const EmbedViewer = (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 /* @__PURE__ */ jsx(
"div",
{
ref: containerRef,
className: "relative h-full w-full overflow-hidden",
dangerouslySetInnerHTML: {
__html: props.src || ""
}
}
);
};
export {
EmbedViewer as default
};