import React, { useContext } from 'react';
import { Box, CircularProgress, Tooltip } from '@mui/material';
import { TorIcon } from './Icons';
import { useTranslation } from 'react-i18next';
import { AppContext, AppContextProps } from '../contexts/AppContext';
interface TorIndicatorProps {
color: 'inherit' | 'error' | 'warning' | 'success' | 'primary' | 'secondary' | 'info' | undefined;
tooltipOpen?: boolean | undefined;
title: string;
progress: boolean;
}
const TorIndicator = ({
color,
tooltipOpen = undefined,
title,
progress,
}: TorIndicatorProps): JSX.Element => {
return (
{progress ? (
<>
>
) : (
)}
);
};
const TorConnectionBadge = (): JSX.Element => {
const { torStatus } = useContext(AppContext);
const { t } = useTranslation();
if (window?.NativeRobosats == null) {
return <>>;
}
if (torStatus === 'NOTINIT') {
return (
);
} else if (torStatus === 'STARTING') {
return (
);
} else if (torStatus === '"Done"' || torStatus === 'DONE') {
return ;
} else {
return (
);
}
};
export default TorConnectionBadge;