File size: 1,616 Bytes
624088c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"use client"

import { CircularProgressbar, buildStyles } from "react-circular-progressbar"
import "react-circular-progressbar/dist/styles.css"

export function ProgressBar ({
  className,
  progressPercentage,
  text
}: {
  className?: string
  progressPercentage?: number
  text?: string
}) {
  return (
    <div className={className}>
      <CircularProgressbar
        // doc: https://www.npmjs.com/package/react-circular-progressbar

        value={progressPercentage || 0}

        // Text to display inside progressbar. Default: ''.
        text={text || ""}   

        // Width of circular line relative to total width of component, a value from 0-100. Default: 8.
        strokeWidth={8}

        
          // As a convenience, you can use buildStyles to configure the most common style changes:

          styles={buildStyles({
            // Rotation of path and trail, in number of turns (0-1)
            rotation: 0,

            // Whether to use rounded or flat corners on the ends - can use 'butt' or 'round'
            strokeLinecap: 'round',

            // Text size
            textSize: '20px',

            // How long animation takes to go from one percentage to another, in seconds
            pathTransitionDuration: 0.1,

            // Can specify path transition in more detail, or remove it entirely
            // pathTransition: 'none',

            // Colors
            // pathColor: `rgba(62, 152, 199, ${percentage / 100})`,
            textColor: '#f88',
            trailColor: '#d6d6d6',
            backgroundColor: '#3e98c7',
          })}
      
      />
    </div>
  )
}