import styles from './StatusDot.module.css'

type StatusDotVariant = 'live' | 'stale' | 'dead' | 'success' | 'warning' | 'error' | 'running'

interface StatusDotProps {
  variant: StatusDotVariant
  pulse?: boolean
  className?: string
}

export function StatusDot({ variant, pulse, className }: StatusDotProps) {
  const showPulse = pulse ?? variant === 'live'
  const classes = [
    styles.dot,
    styles[variant],
    showPulse ? styles.pulse : '',
    className ?? '',
  ].filter(Boolean).join(' ')

  return <span className={classes} aria-hidden="true" />
}
