sigit.io/src/components/LoadingSpinner/index.tsx

34 lines
802 B
TypeScript
Raw Normal View History

import styles from './style.module.scss'
interface Props {
desc?: string
variant?: 'small' | 'default'
}
export const LoadingSpinner = (props: Props) => {
const { desc, variant = 'default' } = props
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>
2024-09-02 09:35:39 +00:00
{desc && (
<p className={styles.loadingSpinnerDesc}>{'Loading...'}</p>
)}
</div>
</div>
)
}
}