import type { ReactNode } from 'react' import Alert from '@mui/material/Alert' import Button from '@mui/material/Button' import Dialog from '@mui/material/Dialog' import DialogActions from '@mui/material/DialogActions' import DialogContent from '@mui/material/DialogContent' import DialogTitle from '@mui/material/DialogTitle' import Typography from '@mui/material/Typography' type Props = { open: boolean onClose: () => void title: ReactNode children: ReactNode actions?: ReactNode loading?: boolean error?: string | null maxWidth?: 'xs' | 'sm' | 'md' | 'lg' } export function AdminDialog({ open, onClose, title, children, actions, loading, error, maxWidth = 'sm' }: Props) { return ( {title} {loading && Загрузка…} {error && {error}} {!loading && !error && children} {actions} ) }