import { VariantProps } from 'class-variance-authority'
import styles from './spinner.module.css'

import { variants } from './variants'

type SpinnerProps = VariantProps<typeof variants>

export function Spinner({ color, size }: SpinnerProps) {
  const classNames = variants({
    color,
    size,
  })

  return (
    <div className={classNames}>
      {[...Array(8)].map((_, i) => (
        <div key={i} className={styles.dot} />
      ))}
    </div>
  )
}
