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 { ConnectedTable } from "./ConnectedTable.js"; import { doesUseTask, TableWithTask } from "./TableWithTask.js"; const Table = (props) => { const usesTask = doesUseTask(props); const [latestRun, setLatestRun] = useState(); if (usesTask) { return /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Table.displayName, latestRun, children: /* @__PURE__ */ jsx(TableWithTask, { ...props, setLatestRun }) }); } else { return /* @__PURE__ */ jsx(ComponentErrorBoundary, { componentName: Table.displayName, children: /* @__PURE__ */ jsx(ConnectedTable, { ...props }) }); } }; Table.displayName = "Table"; export { Table }; //# sourceMappingURL=Table.js.map