function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import * as React from 'react';
import classNames from 'classnames';
import { createUseStyles } from '@fluent-ui/styles';
import { styles } from './Spinner.styled';
import { SpinnerPropTypes } from './Spinner.type';
export const name = 'Spinner';
const useStyles = createUseStyles(styles, {
  name
});
const Spinner = React.forwardRef((props, ref) => {
  const {
    as: Component = 'span',
    className: classNameProp,
    size = 'medium',
    ...rest
  } = props;
  const classes = useStyles(props);
  const className = classNames(classes.root, {
    [classes.sizeSmall]: size === 'small',
    [classes.sizeMedium]: size === 'medium',
    [classes.sizeLarge]: size === 'large'
  }, classNameProp);
  return React.createElement(Component, _extends({
    className: className,
    ref: ref
  }, rest));
});
Spinner.displayName = `F${name}`;
Spinner.propTypes = SpinnerPropTypes;
Spinner.defaultProps = {
  size: 'medium'
};
export default Spinner;