mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
Move all TypeScript interfaces from component files to /lib/interfaces folder Move terminal utility functions to /lib/utils folder Update all component imports to use centralized interfaces and utilities Fix JSX.Element type to React.ReactElement in terminal utils This improves code organization and reduces duplication across components https://claude.ai/code/session_G4kZm
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { Snackbar, Alert, Typography, Button } from '@mui/material';
|
|
import { Warning } from '@mui/icons-material';
|
|
import { FallbackNotificationProps } from '@/lib/interfaces/terminal';
|
|
|
|
export default function FallbackNotification({
|
|
show,
|
|
reason,
|
|
onClose,
|
|
onRetry,
|
|
}: FallbackNotificationProps) {
|
|
return (
|
|
<Snackbar
|
|
open={show}
|
|
autoHideDuration={10000}
|
|
onClose={onClose}
|
|
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
>
|
|
<Alert
|
|
severity="warning"
|
|
icon={<Warning />}
|
|
action={
|
|
<Button color="inherit" size="small" onClick={onRetry}>
|
|
Retry
|
|
</Button>
|
|
}
|
|
onClose={onClose}
|
|
sx={{ width: '100%', maxWidth: '600px' }}
|
|
>
|
|
<Typography variant="body2" sx={{ fontWeight: 600, mb: 0.5 }}>
|
|
Switched to Simple Mode
|
|
</Typography>
|
|
<Typography variant="body2" sx={{ fontSize: '0.875rem' }}>
|
|
{reason}
|
|
</Typography>
|
|
</Alert>
|
|
</Snackbar>
|
|
);
|
|
}
|