mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 21:48:36 +00:00
21 lines
531 B
TypeScript
21 lines
531 B
TypeScript
import { type GraphVisualizationProps } from "./graph-visualization";
|
|
import { useState, useEffect } from "react";
|
|
|
|
export function GraphVisualizationClient(props: GraphVisualizationProps) {
|
|
const [Component, setComponent] = useState<any>(undefined);
|
|
|
|
useEffect(() => {
|
|
if (typeof window === "undefined") return;
|
|
|
|
import("./graph-visualization").then(({ GraphVisualization }) => {
|
|
setComponent(GraphVisualization);
|
|
});
|
|
}, []);
|
|
|
|
if (!Component) {
|
|
return null;
|
|
}
|
|
|
|
return <Component {...props} />;
|
|
}
|