Sha256: db8012bec62088c80ab8bbe236414fca2aeb6cfb903a89686ffb42e021ffd9f1

Contents?: true

Size: 979 Bytes

Versions: 2

Compression:

Stored size: 979 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import {
  Bullseye,
  Title,
  EmptyState,
  EmptyStateIcon,
  Spinner,
  Skeleton,
} from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';

const Loading = ({
  size,
  showText,
  loadingText,
  skeleton,
}) => {
  if (skeleton) {
    return <Skeleton height="100%" />;
  }

  return (
    <Bullseye>
      <EmptyState>
        <EmptyStateIcon size={size} variant="container" component={Spinner} />
        {showText && (
          <Title size={size} headingLevel="h4" ouiaId="loading-title">
            {loadingText || __('Loading')}
          </Title>
        )}
      </EmptyState>
    </Bullseye>
  );
};

Loading.propTypes = {
  size: PropTypes.string,
  showText: PropTypes.bool,
  loadingText: PropTypes.string,
  skeleton: PropTypes.bool,
};

Loading.defaultProps = {
  size: 'lg',
  showText: true,
  loadingText: null,
  skeleton: false,
};

export default Loading;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_patch-1.1.6.alpha5 webpack/src/Components/Loading.js
foreman_patch-1.1.6.alpha4 webpack/src/Components/Loading.js