HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/agentcloud/webapp/src/components/ProgressBar.tsx
import ButtonSpinner from 'components/ButtonSpinner';
import React from 'react';

interface ProgressBarProps {
	total?: number
    success?: number;
	failure?: number;
	text?: string;
}

const ProgressBar: React.FC<ProgressBarProps> = function ({ total=null, success=0, failure=0, text='Embedding' }) {
	const successPercentage = (total != null ? (success/total)*100 : 0) || 0;
	const failurePercentage = (total != null ? (failure/total)*100 : 0) || 0;
	return (<div className='mb-6 h-6 max-w-[300px]'>
		<div className='max-w-[300px] relative top-[22px] -mt-6 text-center text-sm text-white px-2'>
			<span className='tooltip z-100'>
				{text}{' '}
				({successPercentage.toFixed(1).endsWith('0') ? successPercentage : successPercentage.toFixed(1)}%)
				{(successPercentage > 0 || failurePercentage > 0) && <span className='tooltiptext capitalize !w-[150px] !-ml-[75px] whitespace-pre'>
					{total && `${(success||0)+(failure||0)}/${total} (${successPercentage.toFixed(1)}%)\nsuccess: ${success||0}\nfailure: ${failure||0}`}
				</span>}
			</span>
			<ButtonSpinner size={14} className='ms-2 -me-1' />
		</div>
		<div className='flex flex-row overflow-hidden rounded-full bg-gray-400 dark:bg-neutral-600'>
			<span className={'h-6 bg-green-500'} style={{ width: `${successPercentage}%` }} />
			<span className={'h-6 line bg-red-500'} style={{ left: `${failurePercentage}%`, width: `${failurePercentage}%` }} />
		</div>
	</div>);
};

export default ProgressBar;