2025-07-17 16:25:56 +02:00

60 lines
1.4 KiB
TypeScript

import React from 'react';
import { useTranslation } from 'react-i18next';
import { Key, Add } from '@mui/icons-material';
import {
Dialog,
DialogTitle,
DialogActions,
DialogContent,
DialogContentText,
Button,
} from '@mui/material';
import { useNavigate } from 'react-router-dom';
interface Props {
open: boolean;
onClose: () => void;
onClickGenerateRobot?: () => void;
}
const NoRobotDialog = ({
open,
onClose,
onClickGenerateRobot = () => null,
}: Props): React.JSX.Element => {
const { t } = useTranslation();
const navigate = useNavigate();
return (
<Dialog open={open} onClose={onClose}>
<DialogTitle>{t('You do not have a robot avatar')}</DialogTitle>
<DialogContent>
<DialogContentText>
{t('Generate a robot avatar first. Then create your own order.')}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button
onClick={() => {
navigate('garage');
}}
>
<Key /> <div style={{ width: '0.5em' }} />
{t('Recovery')}
</Button>
<Button
onClick={() => {
onClickGenerateRobot();
onClose();
}}
>
<Add /> <div style={{ width: '0.5em' }} />
{t('Add Robot')}
</Button>
</DialogActions>
</Dialog>
);
};
export default NoRobotDialog;