next-app-with-squiggle/components/DynamicSquiggleChart.tsx

27 lines
532 B
TypeScript
Raw Permalink Normal View History

2022-08-01 07:43:16 +00:00
import React from "react";
import dynamic from "next/dynamic";
const SquiggleChart = dynamic<any>(
() => import("@quri/squiggle-components").then((mod) => mod.SquiggleChart),
{
loading: () => <p>Loading...</p>,
ssr: false,
}
);
export function DynamicSquiggleChart(props: any) {
if (props.squiggleString == "") {
return null;
} else {
return (
<SquiggleChart
code={props.squiggleString}
width={445}
height={200}
showSummary={true}
/>
);
}
}