/**
 * Status badge CSS class mappings for all doctypes.
 * Classes map to .ops-badge variants: active, inactive, open, closed, draft
 */

export function locStatusClass (s) {
  return s === 'Active' ? 'active' : s === 'Inactive' ? 'inactive' : 'draft'
}

export function subStatusClass (s) {
  return s === 'Active' ? 'active' : s === 'Cancelled' ? 'inactive' : 'draft'
}

export function eqStatusClass (s) {
  return s === 'Actif' ? 'active' : s === 'Défectueux' || s === 'Perdu' ? 'inactive' : 'draft'
}

export function ticketStatusClass (s) {
  if (s === 'Open') return 'open'
  if (s === 'Closed' || s === 'Resolved') return 'closed'
  if (s === 'Replied') return 'active'
  return 'draft'
}

export function invStatusClass (s) {
  return s === 'Paid' ? 'active' : s === 'Overdue' ? 'inactive' : s === 'Unpaid' ? 'open' : 'draft'
}

export function priorityClass (p) {
  return p === 'Urgent' ? 'inactive' : p === 'High' ? 'open' : p === 'Medium' ? 'draft' : 'active'
}

export function deviceColorClass (status) {
  if (status === 'Actif') return 'dev-green'
  if (status === 'Défectueux' || status === 'Perdu') return 'dev-red'
  return 'dev-grey'
}
