/** German label helpers for enum values and lookups. */
import { de } from '../strings/de'
import type { Gender, GerbilStatus } from '../api/types'

export function genderLabel(gender: Gender): string {
  return de.pages.gerbils.genderLabels[gender]
}

export function statusLabel(status: GerbilStatus): string {
  return de.pages.gerbils.statusLabels[status]
}

/** Format an ISO date ("YYYY-MM-DD") as German "TT.MM.JJJJ"; null -> dash. */
export function formatDate(iso: string | null | undefined): string {
  if (!iso) return '—'
  const [y, m, d] = iso.split('-')
  if (!y || !m || !d) return iso
  return `${d}.${m}.${y}`
}
