import { StyleProps } from './Badge.types'

export const handleStyle = (type: string) => {
  let styles = <StyleProps>{}

  switch (type) {
    case 'fail':
      styles = {
        bg: 'bg-red-200',
        border: 'border-red-800',
        icon: 'fa-regular fa-xmark-circle',
        text: 'text-red-800',
      }
      break

    case 'high':
      styles = {
        bg: 'bg-red-100',
        border: 'border-vapta-red',
        icon: 'fa-regular fa-fire',
        text: 'text-vapta-red',
      }
      break

    case 'low':
      styles = {
        bg: 'bg-green-100',
        border: 'border-green-800',
        icon: 'fa-regular fa-caret-down',
        text: 'text-green-800',
      }
      break

    case 'medium':
      styles = {
        bg: 'bg-orange-100',
        border: 'border-orange-800',
        icon: 'fa-regular fa-clock',
        text: 'text-orange-800',
      }
      break

    case 'pass':
      styles = {
        bg: 'bg-green-100',
        border: 'border-green-800',
        icon: 'fa-regular fa-check-circle',
        text: 'text-green-800',
      }
      break

    case 'pending':
      styles = {
        bg: 'bg-yellow-200',
        border: 'border-yellow-800',
        icon: 'fa-regular fa-clock',
        text: 'text-yellow-800',
      }
      break

    case 'rectified':
      styles = {
        bg: 'bg-green-200',
        border: 'border-green-500',
        icon: 'fa-regular fa-check-double',
        text: 'text-green-800',
      }
      break

    case 'repaired':
      styles = {
        bg: 'bg-orange-200',
        border: 'border-orange-800',
        icon: 'fa-regular fa-clock',
        text: 'text-orange-800',
      }
      break

    default:
      styles = {
        bg: 'bg-gray-300',
        border: 'border-gray-800',
        icon: 'fa-regular fa-clock',
        text: 'text-gray-800',
      }
  }

  return styles
}
