zzz / frontend /src /routes /_oh.app.jupyter.tsx
ar08's picture
Upload 1040 files
246d201 verified
raw
history blame
653 Bytes
import React from "react";
import { JupyterEditor } from "#/components/features/jupyter/jupyter";
function Jupyter() {
const parentRef = React.useRef<HTMLDivElement>(null);
const [parentWidth, setParentWidth] = React.useState(0);
// This is a hack to prevent the editor from overflowing
// Should be removed after revising the parent and containers
React.useEffect(() => {
if (parentRef.current) {
setParentWidth(parentRef.current.offsetWidth);
}
}, []);
return (
<div ref={parentRef} className="h-full">
<JupyterEditor maxWidth={parentWidth} />
</div>
);
}
export default Jupyter;