2025-03-07 11:56:20 +08:00
|
|
|
import cn from '@/utils/classnames'
|
|
|
|
|
2023-12-03 22:10:16 +08:00
|
|
|
type ProgressBarProps = {
|
|
|
|
percent: number
|
|
|
|
color: string
|
|
|
|
}
|
2025-03-07 11:56:20 +08:00
|
|
|
|
2023-12-03 22:10:16 +08:00
|
|
|
const ProgressBar = ({
|
|
|
|
percent = 0,
|
|
|
|
color = '#2970FF',
|
|
|
|
}: ProgressBarProps) => {
|
|
|
|
return (
|
2025-03-21 17:41:03 +08:00
|
|
|
<div className='overflow-hidden rounded-[6px] bg-components-progress-bar-bg'>
|
2023-12-03 22:10:16 +08:00
|
|
|
<div
|
2025-03-07 11:56:20 +08:00
|
|
|
className={cn('h-1 rounded-[6px]', color)}
|
2023-12-03 22:10:16 +08:00
|
|
|
style={{
|
|
|
|
width: `${Math.min(percent, 100)}%`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ProgressBar
|