misc_pterodactyl-panel/resources/scripts/components/elements/Spinner.tsx
2020-02-08 15:23:08 -08:00

31 lines
913 B
TypeScript

import React from 'react';
import classNames from 'classnames';
export type SpinnerSize = 'large' | 'normal' | 'tiny';
interface Props {
size?: SpinnerSize;
centered?: boolean;
className?: string;
}
const Spinner = ({ size, centered, className }: Props) => (
centered ?
<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>
:
<div
className={classNames(`spinner-circle spinner-white ${className}`, {
'spinner-lg': size === 'large',
'spinner-sm': size === 'tiny',
})}
/>
);
export default Spinner;