import type { IStatusBadge } from '../../../global/type'

function statusClasses(status: string, isForWatchOnly: boolean) {
  const commonClasses = 'badge badge-xs'
  if (isForWatchOnly) {
    return `${commonClasses} 'bg-blue-500'`
  }

  return `${commonClasses} ${status == 'Up' ? 'bg-green-500' : 'bg-red-500'}`
}

export default function StatusBadge({ status, isForWatchOnly }: IStatusBadge) {
  return <span className={statusClasses(status, isForWatchOnly)}></span>
}
