mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
23 lines
625 B
Plaintext
23 lines
625 B
Plaintext
---
|
|
import Progress from './Progress.astro'
|
|
import { parsePercentage } from '@shared/lib/string-format'
|
|
|
|
interface Props {
|
|
value?: number | string
|
|
color?: string
|
|
class?: string
|
|
text?: string
|
|
showValue?: boolean
|
|
}
|
|
|
|
const { value, color = 'primary-lt', class: className, text, showValue } = Astro.props
|
|
|
|
const percentage = parsePercentage(value)
|
|
---
|
|
|
|
<div class={`progressbg${className ? ` ${className}` : ''}`}>
|
|
<Progress value={percentage} class="progressbg-progress" color={color} />
|
|
{text && <div class="progressbg-text">{text}</div>}
|
|
{showValue && <div class="progressbg-value">{percentage}%</div>}
|
|
</div>
|