2023-10-23 23:11:59 +02:00
|
|
|
import classNames from "clsx"
|
2023-08-01 18:59:45 +02:00
|
|
|
|
|
|
|
export interface LoaderProps {
|
|
|
|
width?: number
|
|
|
|
height?: number
|
|
|
|
className?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Loader = (props: LoaderProps): JSX.Element => {
|
|
|
|
const { width = 50, height = 50, className } = props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
width,
|
2023-10-23 23:11:59 +02:00
|
|
|
height,
|
2023-08-01 18:59:45 +02:00
|
|
|
}}
|
|
|
|
className={classNames(
|
2024-04-06 20:25:02 +02:00
|
|
|
"inline-block animate-spin rounded-full border-[3px] border-current border-t-transparent text-primary dark:text-primary-dark",
|
2023-10-23 23:11:59 +02:00
|
|
|
className,
|
2023-08-01 18:59:45 +02:00
|
|
|
)}
|
2023-10-23 23:11:59 +02:00
|
|
|
role="status"
|
|
|
|
aria-label="loading"
|
2023-08-01 18:59:45 +02:00
|
|
|
>
|
2023-10-23 23:11:59 +02:00
|
|
|
<span className="sr-only">Loading...</span>
|
2023-08-01 18:59:45 +02:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|