|
|
@ -1,11 +1,15 @@ |
|
|
|
|
|
|
|
import { cn } from '../../lib/classname'; |
|
|
|
|
|
|
|
|
|
|
|
export function CircularProgress({ |
|
|
|
export function CircularProgress({ |
|
|
|
percentage, |
|
|
|
percentage, |
|
|
|
children, |
|
|
|
children, |
|
|
|
isVisible = true, |
|
|
|
isVisible = true, |
|
|
|
|
|
|
|
isActive = false, |
|
|
|
}: { |
|
|
|
}: { |
|
|
|
percentage: number; |
|
|
|
percentage: number; |
|
|
|
children: React.ReactNode; |
|
|
|
children: React.ReactNode; |
|
|
|
isVisible?: boolean; |
|
|
|
isVisible?: boolean; |
|
|
|
|
|
|
|
isActive?: boolean; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
const circumference = 2 * Math.PI * 13; |
|
|
|
const circumference = 2 * Math.PI * 13; |
|
|
|
const strokeDasharray = `${circumference}`; |
|
|
|
const strokeDasharray = `${circumference}`; |
|
|
@ -22,7 +26,9 @@ export function CircularProgress({ |
|
|
|
stroke="currentColor" |
|
|
|
stroke="currentColor" |
|
|
|
strokeWidth="1.75" |
|
|
|
strokeWidth="1.75" |
|
|
|
fill="none" |
|
|
|
fill="none" |
|
|
|
className="text-green-600" |
|
|
|
className={cn('text-gray-400/70', { |
|
|
|
|
|
|
|
'text-black': isActive, |
|
|
|
|
|
|
|
})} |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
strokeDasharray, |
|
|
|
strokeDasharray, |
|
|
|
strokeDashoffset, |
|
|
|
strokeDashoffset, |
|
|
|