import type { NotificationData } from '@/services/notifications/types';

/** The `AppIcon` name for a notification, by its parsed deep-link class. */
export function notificationIcon(kind: NotificationData['kind']): string {
  switch (kind) {
    case 'booking':
      return 'bookings';
    case 'refund':
      return 'payment';
    case 'payout':
      return 'earnings';
    case 'ticket':
      return 'support';
    case 'nurse_profile':
      return 'star';
    case 'none':
    default:
      return 'info';
  }
}

export interface NotificationTint {
  /** Soft-tint background for the icon container. */
  bg: string;
  /** Foreground — the icon color + used for any accent on the row. */
  fg: string;
}

/**
 * Per-kind visual identity (§3.5) — a soft-tinted icon container instead of the uniform primary icon, all
 * from `--bal-*` semantic tokens so dark mode holds by construction. Booking reads teal (the brand's main
 * color), payout success-green, a ticket/support notification warm terracotta (the one deliberate secondary
 * accent, echoing "a human from Balinyaar"), a refund/nurse-trust signal info/trust, and a non-deep-linking
 * notification a fully neutral tint.
 */
export function notificationTint(kind: NotificationData['kind']): NotificationTint {
  switch (kind) {
    case 'booking':
      return { bg: 'var(--bal-primary-soft)', fg: 'var(--bal-primary)' };
    case 'payout':
      return { bg: 'var(--bal-success-soft)', fg: 'var(--bal-success)' };
    case 'ticket':
      return { bg: 'var(--bal-secondary-soft)', fg: 'var(--bal-secondary)' };
    case 'refund':
      return { bg: 'var(--bal-info-soft)', fg: 'var(--bal-info)' };
    case 'nurse_profile':
      return { bg: 'var(--bal-trust-soft)', fg: 'var(--bal-trust)' };
    case 'none':
    default:
      return { bg: 'var(--bal-divider)', fg: 'var(--bal-text-secondary)' };
  }
}
