({
percentage,
className = {},
shouldShowBg,
}: ProgressBarProps)
| 19 | } |
| 20 | |
| 21 | export function ProgressBar({ |
| 22 | percentage, |
| 23 | className = {}, |
| 24 | shouldShowBg, |
| 25 | }: ProgressBarProps): ReactElement { |
| 26 | return ( |
| 27 | <ConditionalWrapper |
| 28 | condition={shouldShowBg ?? false} |
| 29 | wrapper={(component) => ( |
| 30 | <span |
| 31 | className={classNames( |
| 32 | 'flex w-full overflow-hidden bg-accent-pepper-subtler', |
| 33 | className?.wrapper, |
| 34 | )} |
| 35 | > |
| 36 | {component} |
| 37 | </span> |
| 38 | )} |
| 39 | > |
| 40 | <meter |
| 41 | className={classNames( |
| 42 | 'appearance-none transition-[width]', |
| 43 | className?.bar, |
| 44 | className?.barColor ?? 'bg-accent-cabbage-default', |
| 45 | )} |
| 46 | style={{ width: `${percentage >= 0 ? percentage : 0}%` }} |
| 47 | /> |
| 48 | </ConditionalWrapper> |
| 49 | ); |
| 50 | } |
nothing calls this directly
no outgoing calls
no test coverage detected