misc_pterodactyl-panel/resources/scripts/components/elements/Spinner.tsx

30 lines
887 B
TypeScript
Raw Normal View History

import React from 'react';
import classNames from 'classnames';
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) => (
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',
})}
/>
</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',
})}
/>
);