2024-02-28 16:49:44 +00:00
|
|
|
import styles from './style.module.scss'
|
|
|
|
|
|
|
|
interface Props {
|
2024-08-30 10:28:33 +00:00
|
|
|
desc?: string
|
|
|
|
variant?: 'small' | 'default'
|
2024-02-28 16:49:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const LoadingSpinner = (props: Props) => {
|
2024-08-30 10:28:33 +00:00
|
|
|
const { desc, variant = 'default' } = props
|
2024-02-28 16:49:44 +00:00
|
|
|
|
2024-08-30 10:28:33 +00:00
|
|
|
switch (variant) {
|
|
|
|
case 'small':
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={`${styles.loadingSpinnerContainer} ${styles.withHeight}`}
|
|
|
|
>
|
|
|
|
<div className={styles.loadingSpinner}></div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
|
|
|
|
default:
|
|
|
|
return (
|
|
|
|
<div className={styles.loadingSpinnerOverlay}>
|
|
|
|
<div className={styles.loadingSpinnerContainer}>
|
|
|
|
<div className={styles.loadingSpinner}></div>
|
|
|
|
{desc && <span className={styles.loadingSpinnerDesc}>{desc}</span>}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2024-02-28 16:49:44 +00:00
|
|
|
}
|