import type { BadgeVariant } from '../components/ui/Badge';

export const badgeForAppointmentState = (state: string): BadgeVariant => {
  switch (state) {
    case 'confirmed':
      return 'confirmed';
    case 'done':
    case 'completed':
      return 'done';
    case 'cancelled':
      return 'cancelled';
    default:
      return 'pending';
  }
};

export const badgeForPaymentState = (state: string): BadgeVariant => {
  switch (state) {
    case 'confirmed':
    case 'posted':
    case 'paid':
      return 'paid';
    default:
      return 'unpaid';
  }
};

export const badgeForSaleState = (state: string): BadgeVariant => {
  switch (state) {
    case 'sale':
    case 'done':
    case 'paid':
      return 'paid';
    case 'cancel':
      return 'cancelled';
    default:
      return 'pending';
  }
};

export const badgeForCashClosingState = (state: string): BadgeVariant => {
  switch (state) {
    case 'closed':
      return 'done';
    case 'open':
      return 'pending';
    default:
      return 'default';
  }
};
