import { FunctionComponent, useContext } from 'react' import { useTranslation } from 'react-i18next' import { Context } from '../reducer/Store' const ProgressBar: FunctionComponent = () => { // @ts-ignore const { state } = useContext(Context) const { t } = useTranslation() return (
{(() => { if (state.completed === 100) { return t('dlCompleted') } return t('dlProgress') })()}
{state.completed} %
{(() => { if (state.fileProgress === 100) { return t('dlCompleted') } return t('dlFile', { currentFile: state.currentFile }) })()}
{state.fileProgress} %
) } export default ProgressBar