2023-10-23 23:26:27 +02:00
|
|
|
import styles from "./Loader.module.css"
|
2022-10-03 21:23:17 +02:00
|
|
|
|
|
|
|
export interface LoaderProps {
|
|
|
|
width?: number
|
|
|
|
height?: number
|
|
|
|
className?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Loader: React.FC<LoaderProps> = (props) => {
|
2023-12-26 22:24:32 +01:00
|
|
|
const { width = 50, height = 50, className } = props
|
2022-10-03 21:23:17 +02:00
|
|
|
|
|
|
|
return (
|
2023-12-26 22:24:32 +01:00
|
|
|
<div className={className}>
|
2022-10-03 21:23:17 +02:00
|
|
|
<div
|
2023-10-23 23:26:27 +02:00
|
|
|
data-cy="progress-spinner"
|
|
|
|
className="relative my-0 mx-auto before:content-none before:block before:pt-[100%]"
|
2022-10-03 21:23:17 +02:00
|
|
|
style={{ width: `${width}px`, height: `${height}px` }}
|
|
|
|
>
|
2023-10-23 23:26:27 +02:00
|
|
|
<svg className={styles["progressSpinnerSvg"]} viewBox="25 25 50 50">
|
2022-10-03 21:23:17 +02:00
|
|
|
<circle
|
2023-10-23 23:26:27 +02:00
|
|
|
className={styles["progressSpinnerCircle"]}
|
|
|
|
cx="50"
|
|
|
|
cy="50"
|
|
|
|
r="20"
|
|
|
|
fill="none"
|
|
|
|
strokeWidth="2"
|
|
|
|
strokeMiterlimit="10"
|
2022-10-03 21:23:17 +02:00
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|