~cytrogen/masto-fe

ref: 200312e8bed0d91c576cabcdf2ffe0173778cccd masto-fe/app/javascript/mastodon/components/circular_progress.tsx -rw-r--r-- 539 bytes
200312e8 — Rob Thomas Fix crash when viewing a moderation appeal and the moderator account has been deleted (#25900) 2 years 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>
  );
};