2022-09-09 17:18:04 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2022-05-08 22:07:49 +00:00
|
|
|
import {
|
|
|
|
Dialog,
|
|
|
|
DialogTitle,
|
2022-09-09 17:18:04 +00:00
|
|
|
DialogActions,
|
2022-05-08 22:07:49 +00:00
|
|
|
DialogContent,
|
|
|
|
DialogContentText,
|
2022-09-09 17:18:04 +00:00
|
|
|
Button,
|
|
|
|
} from '@mui/material';
|
2022-10-30 19:13:01 +00:00
|
|
|
import { useHistory } from 'react-router-dom';
|
|
|
|
import { Page } from '../../basic/NavBar';
|
2022-05-08 22:07:49 +00:00
|
|
|
|
2022-09-09 17:33:29 +00:00
|
|
|
interface Props {
|
2022-05-08 22:07:49 +00:00
|
|
|
open: boolean;
|
|
|
|
onClose: () => void;
|
2022-10-30 19:13:01 +00:00
|
|
|
setPage: (state: Page) => void;
|
2022-09-09 17:33:29 +00:00
|
|
|
}
|
2022-05-08 22:07:49 +00:00
|
|
|
|
2022-10-30 19:13:01 +00:00
|
|
|
const NoRobotDialog = ({ open, onClose, setPage }: Props): JSX.Element => {
|
2022-05-08 22:07:49 +00:00
|
|
|
const { t } = useTranslation();
|
2022-10-30 19:13:01 +00:00
|
|
|
const history = useHistory();
|
|
|
|
|
|
|
|
const handleClickGenerate = function () {
|
|
|
|
onClose();
|
|
|
|
setPage('robot');
|
|
|
|
history.push('/robot');
|
|
|
|
};
|
2022-05-08 22:07:49 +00:00
|
|
|
|
|
|
|
return (
|
2022-09-09 17:18:04 +00:00
|
|
|
<Dialog open={open} onClose={onClose}>
|
|
|
|
<DialogTitle>{t('You do not have a robot avatar')}</DialogTitle>
|
2022-05-08 22:07:49 +00:00
|
|
|
|
|
|
|
<DialogContent>
|
|
|
|
<DialogContentText>
|
2022-10-30 19:13:01 +00:00
|
|
|
{t('Generate a robot avatar first. Then create your own order.')}
|
2022-05-08 22:07:49 +00:00
|
|
|
</DialogContentText>
|
|
|
|
</DialogContent>
|
|
|
|
|
|
|
|
<DialogActions>
|
2022-10-30 19:13:01 +00:00
|
|
|
<Button onClick={handleClickGenerate}>{t('Generate Robot')}</Button>
|
2022-05-08 22:07:49 +00:00
|
|
|
</DialogActions>
|
|
|
|
</Dialog>
|
2022-09-09 17:18:04 +00:00
|
|
|
);
|
|
|
|
};
|
2022-05-08 22:07:49 +00:00
|
|
|
|
|
|
|
export default NoRobotDialog;
|