2020-02-19 08:10:40 +01:00
|
|
|
import React from 'react';
|
2020-02-19 09:14:11 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2020-02-19 10:27:43 +01:00
|
|
|
import { ClearIcon, useGlobalContext } from 'strapi-helper-plugin';
|
2020-02-19 08:10:40 +01:00
|
|
|
import Button from './Button';
|
|
|
|
import Indicator from './Indicator';
|
|
|
|
import Wrapper from './Wrapper';
|
|
|
|
|
2020-02-19 09:14:11 +01:00
|
|
|
const InfiniteLoadingIndicator = ({ onClick }) => {
|
2020-02-19 10:27:43 +01:00
|
|
|
const { formatMessage } = useGlobalContext();
|
|
|
|
|
2020-02-19 08:10:40 +01:00
|
|
|
return (
|
|
|
|
<Wrapper>
|
|
|
|
<Indicator />
|
2020-02-19 09:14:11 +01:00
|
|
|
<Button type="button" onClick={onClick}>
|
2020-02-19 10:27:43 +01:00
|
|
|
{formatMessage({ id: 'app.components.Button.cancel' })}
|
2020-02-19 08:10:40 +01:00
|
|
|
<ClearIcon />
|
|
|
|
</Button>
|
|
|
|
</Wrapper>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2020-02-19 09:14:11 +01:00
|
|
|
InfiniteLoadingIndicator.defaultProps = {
|
|
|
|
onClick: () => {},
|
|
|
|
};
|
|
|
|
|
|
|
|
InfiniteLoadingIndicator.propTypes = {
|
|
|
|
onClick: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2020-02-19 08:10:40 +01:00
|
|
|
export default InfiniteLoadingIndicator;
|