UNPKG

pagamio-frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

15 lines (14 loc) 504 B
import { jsx as _jsx } from "react/jsx-runtime"; import EmptyMetricState from './EmptyState'; import ErrorState from './ErrorState'; import TileSkeleton from './TileSkeleton'; const ChartWrapper = ({ loading, error, isEmpty, onRetry, children }) => { if (loading) return _jsx(TileSkeleton, {}); if (error) return _jsx(ErrorState, { error: error, onRetry: onRetry }); if (isEmpty) return _jsx(EmptyMetricState, {}); return children; }; export default ChartWrapper;