UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

20 lines (19 loc) 846 B
import { jsx } from "react/jsx-runtime"; import { useState } from "react"; import { ComponentErrorBoundary } from "../errorBoundary/ComponentErrorBoundary.js"; import { doesUseTask, ChartWithTask } from "./ChartWithTask.js"; import { ConnectedChart } from "./ConnectedChart.js"; const Chart = (props) => { const usesTask = doesUseTask(props); const [latestRun, setLatestRun] = useState(); if (usesTask) { return /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Chart.displayName, latestRun, children: /* @__PURE__ */ jsx(ChartWithTask, { ...props, setLatestRun }) }); } else { return /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Chart.displayName, children: /* @__PURE__ */ jsx(ConnectedChart, { ...props }) }); } }; Chart.displayName = "Chart"; export { Chart }; //# sourceMappingURL=Chart.js.map