{"size": 2903, "ext": "js", "max_stars_repo_path": "src/utils/notifications.js", "max_stars_repo_name": "kleros/gtcr", "max_stars_repo_stars_event_min_datetime": "2020-02-04T08:36:01.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-06T01:51:24.000Z", "max_issues_repo_path": "src/utils/notifications.js", "max_issues_repo_name": "kleros/gtcr", "max_issues_repo_issues_event_min_datetime": "2019-10-18T04:19:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-23T10:00:59.000Z", "max_forks_repo_path": "src/utils/notifications.js", "max_forks_repo_name": "kleros/gtcr", "max_forks_repo_forks_event_min_datetime": "2022-02-16T13:38:51.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-16T13:38:51.000Z"}
{"max_stars_count": 7, "max_issues_count": 180, "max_forks_count": 1, "avg_line_length": 38.7066666667, "max_line_length": 75, "alphanum_fraction": 0.7712710989}
export const NOTIFICATION_TYPES = {
  SUBMISSION_PENDING: 'SUBMISSION_PENDING',
  REMOVAL_PENDING: 'REMOVAL_PENDING',
  SUBMISSION_ACCEPTED: 'SUBMISSION_ACCEPTED',
  REMOVAL_ACCEPTED: 'REMOVAL_ACCEPTED',
  SUBMISSION_CHALLENGED: 'SUBMISSION_CHALLENGED',
  REMOVAL_CHALLENGED: 'REMOVAL_CHALLENGED',
  EVIDENCE_SUBMITTED: 'EVIDENCE_SUBMITTED',
  APPEALED: 'APPEALED',
  APPEALABLE_RULING: 'APPEALABLE_RULING',
  FINAL_RULING: 'FINAL_RULING',
  HAS_PAID_FEES: 'HAS_PAID_FEES'
}

export const typeToMessage = {
  [NOTIFICATION_TYPES.SUBMISSION_PENDING]: 'Submission pending execution.',
  [NOTIFICATION_TYPES.REMOVAL_PENDING]: 'Removal pending execution.',
  [NOTIFICATION_TYPES.SUBMISSION_ACCEPTED]: 'Submission accepted.',
  [NOTIFICATION_TYPES.REMOVAL_ACCEPTED]: 'Removal accepted.',
  [NOTIFICATION_TYPES.SUBMISSION_CHALLENGED]: 'Submission challenged.',
  [NOTIFICATION_TYPES.REMOVAL_CHALLENGED]: 'Removal challenged.',
  [NOTIFICATION_TYPES.EVIDENCE_SUBMITTED]: 'Evidence submitted.',
  [NOTIFICATION_TYPES.APPEALED]: 'Ruling appealed',
  [NOTIFICATION_TYPES.APPEALABLE_RULING]: 'The Arbitrator gave a ruling',
  [NOTIFICATION_TYPES.FINAL_RULING]: 'Ruling enforced.',
  [NOTIFICATION_TYPES.HAS_PAID_FEES]: 'Side fully funded'
}

export const getNotificationColorFor = notificationType => {
  switch (notificationType) {
    case NOTIFICATION_TYPES.SUBMISSION_PENDING:
    case NOTIFICATION_TYPES.REMOVAL_PENDING:
      return '#ccc'
    case NOTIFICATION_TYPES.EVIDENCE_SUBMITTED:
    case NOTIFICATION_TYPES.SUBMISSION_ACCEPTED:
    case NOTIFICATION_TYPES.REMOVAL_ACCEPTED:
      return '#208efa' // Antd Blue.
    case NOTIFICATION_TYPES.APPEALED:
    case NOTIFICATION_TYPES.SUBMISSION_CHALLENGED:
    case NOTIFICATION_TYPES.REMOVAL_CHALLENGED:
      return '#fa8d39' // Antd Orange.
    case NOTIFICATION_TYPES.APPEALABLE_RULING:
    case NOTIFICATION_TYPES.HAS_PAID_FEES:
      return '#722ed1' // Antd Purple.
    case NOTIFICATION_TYPES.FINAL_RULING:
      return '#f95638' // Antd Volcano.
    default:
      throw new Error('Unhandled notification type')
  }
}

export const getNotificationIconFor = notificationType => {
  switch (notificationType) {
    case NOTIFICATION_TYPES.SUBMISSION_PENDING:
    case NOTIFICATION_TYPES.REMOVAL_PENDING:
      return 'hourglass-half'
    case NOTIFICATION_TYPES.EVIDENCE_SUBMITTED:
      return 'file-alt'
    case NOTIFICATION_TYPES.SUBMISSION_ACCEPTED:
    case NOTIFICATION_TYPES.REMOVAL_ACCEPTED:
      return 'check'
    case NOTIFICATION_TYPES.APPEALED:
    case NOTIFICATION_TYPES.SUBMISSION_CHALLENGED:
    case NOTIFICATION_TYPES.REMOVAL_CHALLENGED:
      return 'balance-scale'
    case NOTIFICATION_TYPES.APPEALABLE_RULING:
    case NOTIFICATION_TYPES.FINAL_RULING:
      return 'gavel'
    case NOTIFICATION_TYPES.HAS_PAID_FEES:
      return 'exclamation-triangle'
    default:
      throw new Error('Unhandled notification type')
  }
}
