export const RECONCILIATION_SECTIONS = [
  {
    checkType: 'UNACKNOWLEDGED_CRITICAL_ALERT',
    title: 'Unacknowledged critical alerts',
    description: 'Critical alerts open longer than the configured threshold.',
  },
  {
    checkType: 'PENDING_ORDER_NO_RESULT',
    title: 'Pending orders without results',
    description: 'Orders placed but not resulted within the expected window.',
  },
  {
    checkType: 'ACTIVE_INPATIENT_NO_OBSERVATION',
    title: 'Stale observations',
    description: 'Active inpatients without recent vital sign recordings.',
  },
]

const CHECK_TYPE_LABELS = {
  UNACKNOWLEDGED_CRITICAL_ALERT: 'Unacknowledged critical alerts',
  UnacknowledgedCriticalAlert: 'Unacknowledged critical alerts',
  PENDING_ORDER_NO_RESULT: 'Pending orders without results',
  PendingOrderNoResult: 'Pending orders without results',
  ACTIVE_INPATIENT_NO_OBSERVATION: 'Stale observations',
  ActiveInpatientNoObservation: 'Stale observations',
}

export function checkTypeLabel(checkType) {
  return CHECK_TYPE_LABELS[checkType] ?? checkType
}

export function formatReconciliationTimestamp(iso) {
  if (!iso) return '—'
  return new Date(iso).toLocaleString([], {
    month: 'short',
    day: 'numeric',
    year: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
  })
}
