UNPKG

@atlaskit/dynamic-table

Version:

A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.

37 lines 1.26 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; import React from 'react'; import Spinner from '@atlaskit/spinner/spinner'; import { Container } from '../styled/container'; import { ContentsContainer } from '../styled/contents-container'; import { SpinnerContainer } from '../styled/spinner-container'; // eslint-disable-next-line @repo/internal/react/no-class-components export default class LoadingContainer extends React.Component { render() { const { children, isLoading, spinnerSize, contentsOpacity, testId, loadingLabel } = this.props; return /*#__PURE__*/React.createElement(Container, { testId: testId }, !isLoading ? children : /*#__PURE__*/React.createElement(ContentsContainer, { contentsOpacity: contentsOpacity, testId: testId }, children), isLoading && /*#__PURE__*/React.createElement(SpinnerContainer, { testId: testId }, /*#__PURE__*/React.createElement(Spinner, { size: spinnerSize, testId: testId && `${testId}--loadingSpinner`, label: loadingLabel }))); } } _defineProperty(LoadingContainer, "defaultProps", { isLoading: true, spinnerSize: 'large', contentsOpacity: 0.22, loadingLabel: 'Loading table' });