circular_progress.tsx 539 B

123456789101112131415161718192021222324252627
  1. interface Props {
  2. size: number;
  3. strokeWidth: number;
  4. }
  5. export const CircularProgress: React.FC<Props> = ({ size, strokeWidth }) => {
  6. const viewBox = `0 0 ${size} ${size}`;
  7. const radius = (size - strokeWidth) / 2;
  8. return (
  9. <svg
  10. width={size}
  11. height={size}
  12. viewBox={viewBox}
  13. className='circular-progress'
  14. role='progressbar'
  15. >
  16. <circle
  17. fill='none'
  18. cx={size / 2}
  19. cy={size / 2}
  20. r={radius}
  21. strokeWidth={`${strokeWidth}px`}
  22. />
  23. </svg>
  24. );
  25. };