Files
docker-swarm-termina/frontend/components/TerminalModal/FallbackNotification.tsx
Claude e97b50a916 Organize interfaces and utilities into centralized folders
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
2026-01-30 23:16:45 +00:00

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>
);
}