File size: 2,100 Bytes
c2ea5ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { Trace } from "@/types";

// Consolidated status color utility for traces
export const getTraceStatusColor = (status: Trace["status"]) => {
  switch (status) {
    case "completed":
      return "bg-green-500/10 text-green-700 border-green-200";
    case "processing":
      return "bg-blue-500/10 text-blue-700 border-blue-200";
    case "error":
      return "bg-red-500/10 text-red-700 border-red-200";
    default:
      return "bg-gray-500/10 text-gray-700 border-gray-200";
  }
};

// Consolidated status variant utility for knowledge graphs
export const getKnowledgeGraphStatusVariant = (
  status: string
): "default" | "secondary" | "destructive" | "outline" => {
  switch (status) {
    case "created":
      return "secondary";
    case "enriched":
    case "perturbed":
    case "analyzed":
    case "causal":
      return "default";
    case "error":
      return "destructive";
    default:
      return "outline";
  }
};

// Consolidated status message utility
export const getStatusMessage = (status: string) => {
  switch (status) {
    case "created":
      return "Created";
    case "enriched":
      return "Prompt Reconstructed";
    case "perturbed":
      return "Perturbation Tested";
    case "analyzed":
    case "causal":
      return "Processed"; // Removed "Causal Analyzed" since checkmarks already indicate completion
    case "error":
      return "Error";
    case "processing":
      return "Processing";
    case "completed":
      return "Completed";
    default:
      return "Unknown";
  }
};

// Pipeline status colors
export const getPipelineStatusColor = (status: string) => {
  switch (status) {
    case "completed":
      return "bg-green-500/10 text-green-700 border-green-200";
    case "running":
    case "processing":
      return "bg-blue-500/10 text-blue-700 border-blue-200";
    case "failed":
    case "error":
      return "bg-red-500/10 text-red-700 border-red-200";
    case "pending":
      return "bg-yellow-500/10 text-yellow-700 border-yellow-200";
    default:
      return "bg-gray-500/10 text-gray-700 border-gray-200";
  }
};