import Axios from "axiosInstance";
import useAxiosProgressBar from "use-axios-progress-bar";
import LinearProgress from "@material-ui/core/LinearProgress";
import { css } from "@emotion/core";
const fixedProgressBarCss = css`
&&{
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
}
`;
const AxiosProgressIndicator = () => {
const loaded = useAxiosProgressBar({
axiosInstance: Axios,
delay: 500
});
return loaded === -1 ? null : (
<LinearProgress
css={fixedProgressBarCss}
value={loaded}
variant={loaded>0?"determinate":"indeterminate"}
/>
);
}