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

32 lines
913 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;
}
2020-02-08 23:23:08 +00:00
const Spinner = ({ 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',
})}
/>
);
2020-02-08 23:23:08 +00:00
export default Spinner;