-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (36 loc) · 840 Bytes
/
index.js
File metadata and controls
40 lines (36 loc) · 840 Bytes
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
import React from 'react';
import StyledWrapper from './StyledWrapper';
const Spinner = ({ size = 'md', children }) => {
const sizeMap = {
xs: 12,
sm: 16,
md: 20,
lg: 24,
xl: 32
};
const spinnerSize = sizeMap[size] || 20;
return (
<StyledWrapper $size={size}>
<span className="spinner">
<svg
width={spinnerSize}
height={spinnerSize}
viewBox="0 0 24 24"
fill="none"
>
<circle
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="3"
strokeLinecap="round"
strokeDasharray="31.4 31.4"
/>
</svg>
</span>
{children && <div className="spinner-text">{children}</div>}
</StyledWrapper>
);
};
export default Spinner;