// Audit trail configuration

export type AuditResult = "success" | "error";
export type AuditAction = "query" | "ingest" | "restore" | "delete" | "reset";

export const resultLabels: Record<AuditResult, string> = {
  success: "OK",
  error: "Error",
};

export const resultColors: Record<AuditResult, string> = {
  success: "bg-emerald-500/20 text-emerald-700 dark:text-emerald-300",
  error: "bg-red-500/20 text-red-700 dark:text-red-300",
};

export const actionLabels: Record<string, string> = {
  query: "Query",
  ingest: "Ingest",
  restore: "Restore",
  delete: "Delete",
  reset: "Reset",
  skeptic: "Skeptic Query",
  layered: "Layered Query",
};

// Latency thresholds in milliseconds
export const latencyThresholds = {
  good: 100,    // < 100ms = green
  warning: 500, // 100-500ms = yellow
  // > 500ms = red
};

export const latencyColors = {
  good: "text-emerald-600 dark:text-emerald-400",
  warning: "text-amber-600 dark:text-amber-400",
  slow: "text-red-600 dark:text-red-400",
};

export function getLatencyLevel(ms: number): "good" | "warning" | "slow" {
  if (ms < latencyThresholds.good) return "good";
  if (ms < latencyThresholds.warning) return "warning";
  return "slow";
}
