import React, { memo, forwardRef } from 'react';
import { ActivityIndicator } from 'react-native';
import { usePropsResolution, useStyledSystemPropsResolver } from '../../../hooks';
import { getColor } from '../../../theme';
import { useTheme } from '../../../hooks';

const Spinner = (props, ref) => {
  const {
    color,
    boxSize,
    style,
    testID,
    ...resolvedProps
  } = usePropsResolution('Spinner', props);
  const resolvedColor = getColor(color, useTheme().colors, useTheme());
  const resolvedStyle = useStyledSystemPropsResolver(resolvedProps); // console.log('Spinner size', size, resolvedProps);

  return /*#__PURE__*/React.createElement(ActivityIndicator, {
    testID: testID,
    accessible: true,
    accessibilityLabel: "loading",
    color: resolvedColor,
    ref: ref,
    size: boxSize // boxSize={boxSize}
    ,
    style: [resolvedStyle, style]
  });
};

export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Spinner));
//# sourceMappingURL=index.js.map