UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

36 lines 1.18 kB
import { head } from "lodash"; import React, { useState } from "react"; import TopBar from "./Module/TopBar"; import DataSourceSelector from "./Module/TopBar/Components/DataSourceSelector"; import { DictionaryProvider } from "./Store/DictionaryContext"; export default function DictionaryAnalysis(_ref) { let { dataSources } = _ref; const [selectedDataSource, setSelectedDataSource] = useState(head(dataSources)); const [values, setValues] = useState(); return /*#__PURE__*/React.createElement(DictionaryProvider, { value: { values, setValues } }, /*#__PURE__*/React.createElement("div", { style: { overflow: "hidden" }, className: "column" }, /*#__PURE__*/React.createElement(TopBar, { selectedTab: selectedDataSource, dataSources: dataSources, onTabChange: setSelectedDataSource }), /*#__PURE__*/React.createElement("div", { style: { overflow: "auto", maxHeight: "100%", flex: 1, padding: " 0 16px" } }, /*#__PURE__*/React.createElement(DataSourceSelector, { id: selectedDataSource === null || selectedDataSource === void 0 ? void 0 : selectedDataSource.id })))); }