~cytrogen/masto-fe

ref: 4b4a9f981f7edb321b6c8e8c0c689fa77e1b550d masto-fe/app/javascript/flavours/glitch/components/circular_progress.tsx -rw-r--r-- 539 bytes
4b4a9f98 — tobi [chore] Update to yarn 4 (#90) 6 months ago
                                                                                
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
interface Props {
  size: number;
  strokeWidth: number;
}

export const CircularProgress: React.FC<Props> = ({ size, strokeWidth }) => {
  const viewBox = `0 0 ${size} ${size}`;
  const radius = (size - strokeWidth) / 2;

  return (
    <svg
      width={size}
      height={size}
      viewBox={viewBox}
      className='circular-progress'
      role='progressbar'
    >
      <circle
        fill='none'
        cx={size / 2}
        cy={size / 2}
        r={radius}
        strokeWidth={`${strokeWidth}px`}
      />
    </svg>
  );
};