12 lines
394 B
TypeScript
12 lines
394 B
TypeScript
import { lazy, Suspense } from "react";
|
|
import type { EChartsCoreOption } from "echarts/core";
|
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
const EChart = lazy(() => import("./EChartImpl"));
|
|
export function Chart(props: { option: EChartsCoreOption; label: string }) {
|
|
return (
|
|
<Suspense fallback={<Skeleton className="h-64" />}>
|
|
<EChart {...props} />
|
|
</Suspense>
|
|
);
|
|
}
|