import { IconCheck, IconX } from '@tabler/icons-react' /** * ProgressBar - компонент прогресс бара с estimated time * @param {number} progress - прогресс от 0 до 100 * @param {string} status - статус операции * @param {number} estimatedTime - оставшееся время в секундах * @param {string} variant - цвет: 'primary', 'success', 'danger', 'warning' */ function ProgressBar({ progress = 0, status = '', estimatedTime = null, variant = 'primary', showPercentage = true, striped = false, animated = false, size = 'default' // 'sm', 'default', 'lg' }) { const sizeClass = size === 'sm' ? 'progress-sm' : size === 'lg' ? 'progress-lg' : '' const stripedClass = striped ? 'progress-bar-striped' : '' const animatedClass = animated ? 'progress-bar-animated' : '' const formatTime = (seconds) => { if (seconds < 60) { return `${Math.round(seconds)} сек` } else if (seconds < 3600) { const minutes = Math.floor(seconds / 60) const secs = Math.round(seconds % 60) return `${minutes} мин ${secs} сек` } else { const hours = Math.floor(seconds / 3600) const minutes = Math.floor((seconds % 3600) / 60) return `${hours} ч ${minutes} мин` } } return (