mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
35 lines
664 B
JavaScript
35 lines
664 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import { icons } from 'Helpers/Props';
|
|
import Icon from './Icon';
|
|
|
|
function SpinnerIcon(props) {
|
|
const {
|
|
name,
|
|
spinningName,
|
|
isSpinning,
|
|
...otherProps
|
|
} = props;
|
|
|
|
return (
|
|
<Icon
|
|
name={isSpinning ? (spinningName || name) : name}
|
|
isSpinning={isSpinning}
|
|
{...otherProps}
|
|
/>
|
|
);
|
|
}
|
|
|
|
SpinnerIcon.propTypes = {
|
|
className: PropTypes.string,
|
|
name: PropTypes.object.isRequired,
|
|
spinningName: PropTypes.object.isRequired,
|
|
isSpinning: PropTypes.bool.isRequired
|
|
};
|
|
|
|
SpinnerIcon.defaultProps = {
|
|
spinningName: icons.SPINNER
|
|
};
|
|
|
|
export default SpinnerIcon;
|