import React, { useContext } from 'react'; import { useTranslation } from 'react-i18next'; import { useTheme } from '@mui/material/styles'; import QRCode from 'react-qr-code'; import { Box, Dialog, DialogTitle, DialogActions, DialogContent, DialogContentText, Button, Grid, } from '@mui/material'; import { NewTabIcon } from '../Icons'; import { AppContext, type UseAppStoreType } from '../../contexts/AppContext'; interface Props { open: boolean; onClose: () => void; tgBotName: string; tgToken: string; } const EnableTelegramDialog = ({ open, onClose, tgBotName, tgToken }: Props): JSX.Element => { const { settings } = useContext(AppContext); const { t } = useTranslation(); const theme = useTheme(); const handleClickOpenBrowser = () => { window.open(`https://t.me/${tgBotName}?start=${tgToken}`, '_blank').focus(); setOpenEnableTelegram(false); }; const handleOpenTG = () => { window.open(`tg://resolve?domain=${tgBotName}&start=${tgToken}`); }; return ( {t('Enable TG Notifications')} {t( 'You will be taken to a conversation with RoboSats telegram bot. Simply open the chat and press Start. Note that by enabling telegram notifications you might lower your level of anonymity.', )} ); }; export default EnableTelegramDialog;