enum ReportStatus {
  open,
  reviewed,
  resolved,
  dismissed,
}

ReportStatus normalizeReportStatus(String? status) {
  switch ((status ?? '').toLowerCase()) {
    case 'reviewed':
      return ReportStatus.reviewed;
    case 'resolved':
      return ReportStatus.resolved;
    case 'dismissed':
      return ReportStatus.dismissed;
    default:
      return ReportStatus.open;
  }
}

String reportStatusLabel(ReportStatus status) {
  switch (status) {
    case ReportStatus.reviewed:
      return 'Reviewed';
    case ReportStatus.resolved:
      return 'Resolved';
    case ReportStatus.dismissed:
      return 'Dismissed';
    case ReportStatus.open:
      return 'Open';
  }
}

String formatReportDateTime(DateTime date) {
  final d = date.toLocal();
  final mm = d.month.toString().padLeft(2, '0');
  final dd = d.day.toString().padLeft(2, '0');
  final hh = d.hour.toString().padLeft(2, '0');
  final min = d.minute.toString().padLeft(2, '0');
  return '$dd.$mm.${d.year} $hh:$min';
}
