import RefreshIcon from '@mui/icons-material/Refresh';
import { Box, Button, CircularProgress, Typography } from '@mui/material';
import { MessageBox } from 'components';
import { useI18nContext } from 'i18n/i18n-react';
interface FormLoaderProps {
message?: string;
errorMessage?: string;
onRetry?: () => void;
}
const FormLoader = ({
errorMessage,
onRetry,
message = 'Loading…'
}: FormLoaderProps) => {
const { LL } = useI18nContext();
if (errorMessage) {
return (
{onRetry && (
}
variant="contained"
color="error"
onClick={onRetry}
>
{LL.RETRY()}
)}
);
}
return (
{message}
);
};
export default FormLoader;