mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
30 lines
581 B
JavaScript
30 lines
581 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
export default function LoadingIndicator({
|
|
alt,
|
|
title,
|
|
isLoading,
|
|
children = null,
|
|
}) {
|
|
return isLoading ? (
|
|
<span className="loading-indicator">
|
|
<img
|
|
className="loading-indicator__spinner"
|
|
alt={alt}
|
|
title={title}
|
|
src="images/loading.svg"
|
|
/>
|
|
</span>
|
|
) : (
|
|
children
|
|
);
|
|
}
|
|
|
|
LoadingIndicator.propTypes = {
|
|
isLoading: PropTypes.bool.isRequired,
|
|
alt: PropTypes.string.isRequired,
|
|
title: PropTypes.string.isRequired,
|
|
children: PropTypes.node,
|
|
};
|