components.common.TimedLoader.tsx Maven / Gradle / Ivy
import * as React from 'react';
import Box from '@mui/material/Box';
import CircularProgress, { CircularProgressProps } from '@mui/material/CircularProgress';
import Typography from '@mui/material/Typography';
const TimedLoader = () => {
const [progress, setProgress] = React.useState(10);
React.useEffect(() => {
const timer = setInterval(() => {
setProgress((prevProgress) => (prevProgress >= 100 ? 0 : prevProgress + 10));
}, 800);
return () => {
clearInterval(timer);
};
}, []);
return ;
}
export const CircularProgressWithLabel = (
props: CircularProgressProps & { value: number, label: string, circleSize: string },
) => {
const { circleSize: ignore, ...style} = props
return (
{props.label}
);
}
export default TimedLoader