import React, { useEffect, useState } from 'react';
import { Box, CircularProgress, Tooltip } from '@mui/material';
import { TorIcon } from './Icons';
import { useTranslation } from 'react-i18next';
import { gridQuickFilterValuesSelector } from '@mui/x-data-grid';
interface Props {
color: 'inherit' | 'error' | 'warning' | 'success' | 'primary' | 'secondary' | 'info' | undefined;
tooltipOpen?: boolean | undefined;
title: string;
progress: boolean;
}
const TorIndicator = ({ color, tooltipOpen = undefined, title, progress }: Props): JSX.Element => {
return (
{progress ? (
<>
>
) : (
)}
);
};
const TorConnection = (): JSX.Element => {
const [torStatus, setTorStatus] = useState('NOTINIT');
const { t } = useTranslation();
useEffect(() => {
window.addEventListener('torStatus', (event) => {
setTorStatus(event?.detail);
});
}, []);
if (!window?.NativeRobosats) {
return <>>;
}
if (torStatus === 'NOTINIT') {
return (
);
} else if (torStatus === 'STARTING') {
return (
);
} else if (torStatus === '"Done"' || torStatus === 'DONE') {
return ;
} else {
return (
);
}
};
export default TorConnection;