-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathcategoryConfig.ts
More file actions
52 lines (49 loc) · 1.72 KB
/
Copy pathcategoryConfig.ts
File metadata and controls
52 lines (49 loc) · 1.72 KB
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
import type { Icon } from "@phosphor-icons/react";
import {
Bug,
ChartLine,
Copy,
Flag,
Flask,
Funnel,
Gauge,
Lightning,
Lock,
Sparkle,
Trash,
Warning,
Wrench,
} from "@phosphor-icons/react";
import type { DiscoveredTask } from "@posthog/core/setup/types";
export interface CategoryConfig {
icon: Icon;
color: string;
label: string;
}
// Single source of truth for how each `DiscoveredTask` category renders.
// Consumers (suggestion cards, detail pane, etc.) read from here so that
// adding a category to `DiscoveredTask` only requires updating one map.
export const CATEGORY_CONFIG: Record<
DiscoveredTask["category"],
CategoryConfig
> = {
bug: { icon: Bug, color: "red", label: "Bug" },
security: { icon: Lock, color: "red", label: "Security" },
dead_code: { icon: Trash, color: "gray", label: "Dead code" },
duplication: { icon: Copy, color: "orange", label: "Duplication" },
performance: { icon: Lightning, color: "green", label: "Performance" },
stale_feature_flag: { icon: Flag, color: "amber", label: "Stale flag" },
error_tracking: { icon: Warning, color: "orange", label: "Error tracking" },
event_tracking: { icon: ChartLine, color: "blue", label: "Event tracking" },
funnel: { icon: Funnel, color: "violet", label: "Funnel" },
posthog_setup: { icon: Sparkle, color: "violet", label: "PostHog setup" },
experiment: { icon: Flask, color: "purple", label: "Experiment" },
ai_usage: { icon: Gauge, color: "cyan", label: "AI usage" },
};
// Fallback when a `DiscoveredTask.category` somehow doesn't match the map
// (e.g. an agent emits a value the schema didn't constrain).
export const FALLBACK_CATEGORY_CONFIG: CategoryConfig = {
icon: Wrench,
color: "gray",
label: "Suggestion",
};