import React from 'react';
import {
  ActivityIndicatorProps as RNActivityIndicatorProps,
  // eslint-disable-next-line no-restricted-imports
  ActivityIndicator as RNActivityIndicator,
} from 'react-native';
import {COLORS} from '@shared/colors';

import {styles} from './styles';

interface ActivityIndicatorProps extends RNActivityIndicatorProps {
  fullScreen?: boolean;
  isVisible?: boolean;
}

/**
 * @deprecated - Use `_HuGo/Spinner` instead
 */
const ActivityIndicator = ({
  color = COLORS.PRIMARY,
  size = 'small',
  style,
  fullScreen,
  isVisible = true,
}: ActivityIndicatorProps) => {
  return isVisible ? (
    <RNActivityIndicator
      animating
      color={color}
      size={size}
      style={[fullScreen && styles.fullScreen, style]}
    />
  ) : null;
};

export default ActivityIndicator;
