import type { FC, HTMLAttributes, ReactNode } from 'react'; import type { Position } from '../../../../types'; import styles from './spinner.module.scss'; export type SpinnerProps = Omit, 'children'> & { /** * The loading message. */ children?: ReactNode; /** * Define the position of the loading message if any. * * @default 'right' */ position?: Exclude; }; /** * Spinner component * * Render a loading message with animation. */ export const Spinner: FC = ({ children, className = '', position = 'right', ...props }) => { const positionClass = styles[`wrapper--${position}`]; const wrapperClass = `${styles.wrapper} ${positionClass} ${className}`; return (
{children}
); };