2025-03-04 19:46:54 +03:00
|
|
|
import Button from '@mui/material/Button';
|
|
|
|
import Dialog, { type DialogProps } from '@mui/material/Dialog';
|
|
|
|
import DialogActions from '@mui/material/DialogActions';
|
|
|
|
import DialogContent from '@mui/material/DialogContent';
|
|
|
|
import DialogContentText from '@mui/material/DialogContentText';
|
|
|
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
|
|
import globalize from 'lib/globalize';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
interface SimpleAlertDialog extends DialogProps {
|
2025-03-06 04:29:08 +03:00
|
|
|
title?: string;
|
2025-03-04 19:46:54 +03:00
|
|
|
text: string;
|
|
|
|
onClose: () => void
|
|
|
|
};
|
|
|
|
|
|
|
|
const SimpleAlert = ({ open, title, text, onClose }: SimpleAlertDialog) => {
|
|
|
|
return (
|
|
|
|
<Dialog open={open} onClose={onClose}>
|
2025-03-06 04:29:08 +03:00
|
|
|
{title && (
|
|
|
|
<DialogTitle>
|
|
|
|
{title}
|
|
|
|
</DialogTitle>
|
|
|
|
)}
|
2025-03-04 19:46:54 +03:00
|
|
|
<DialogContent>
|
|
|
|
<DialogContentText>
|
|
|
|
{text}
|
|
|
|
</DialogContentText>
|
|
|
|
</DialogContent>
|
|
|
|
<DialogActions>
|
|
|
|
<Button onClick={onClose}>
|
|
|
|
{globalize.translate('ButtonGotIt')}
|
|
|
|
</Button>
|
|
|
|
</DialogActions>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SimpleAlert;
|