import React from 'react'; import { Alert, LinearProgress, Stack, Typography } from '@mui/material'; import CheckCircleIcon from '@mui/icons-material/CheckCircle'; import ErrorIcon from '@mui/icons-material/ErrorOutline'; import HourglassTopIcon from '@mui/icons-material/HourglassTop'; interface AsyncStatusBannerProps { state: 'idle' | 'running' | 'success' | 'error'; message?: string; } export const AsyncStatusBanner: React.FC = ({ state, message, }) => { if (state === 'idle') return null; if (state === 'running') { return ( {message || 'Processing request…'} ); } if (state === 'success') { return ( } severity="success" sx={{ borderRadius: 2 }} > {message || 'Completed successfully.'} ); } return ( } severity="error" sx={{ borderRadius: 2 }} > {message || 'Something went wrong.'} ); };