1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/frontend/src/Components/SpinnerIcon.js
2023-02-12 19:16:07 -08:00

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;