2019-06-29 23:14:32 +00:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2019-08-17 23:03:10 +00:00
|
|
|
export type SpinnerSize = 'large' | 'normal' | 'tiny';
|
|
|
|
|
2019-12-22 22:53:27 +00:00
|
|
|
interface Props {
|
|
|
|
size?: SpinnerSize;
|
|
|
|
centered?: boolean;
|
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ({ size, centered, className }: Props) => (
|
2019-07-10 05:00:29 +00:00
|
|
|
centered ?
|
2019-12-22 22:53:27 +00:00
|
|
|
<div className={classNames(`flex justify-center ${className}`, { 'm-20': size === 'large', 'm-6': size !== 'large' })}>
|
|
|
|
<div
|
|
|
|
className={classNames('spinner-circle spinner-white', {
|
|
|
|
'spinner-lg': size === 'large',
|
|
|
|
'spinner-sm': size === 'tiny',
|
|
|
|
})}
|
|
|
|
/>
|
2019-07-10 05:00:29 +00:00
|
|
|
</div>
|
|
|
|
:
|
2019-12-22 22:53:27 +00:00
|
|
|
<div
|
|
|
|
className={classNames(`spinner-circle spinner-white ${className}`, {
|
|
|
|
'spinner-lg': size === 'large',
|
|
|
|
'spinner-sm': size === 'tiny',
|
|
|
|
})}
|
|
|
|
/>
|
2019-06-29 23:14:32 +00:00
|
|
|
);
|