Seth0330 commited on
Commit
e884baf
·
verified ·
1 Parent(s): ff974fe

Create AIActionPlan.jsx

Browse files
frontend/src/components/admin/AIActionPlan.jsx ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // frontend/src/components/admin/AIActionPlan.jsx
2
+ import React from "react";
3
+ import { CheckCircle2, Clock, Circle, Target } from "lucide-react";
4
+
5
+ const statusIcons = {
6
+ completed: CheckCircle2,
7
+ in_progress: Clock,
8
+ pending: Circle,
9
+ };
10
+
11
+ const statusColors = {
12
+ completed: "text-green-600 bg-green-50",
13
+ in_progress: "text-blue-600 bg-blue-50",
14
+ pending: "text-amber-600 bg-amber-50",
15
+ };
16
+
17
+ const categoryColors = {
18
+ Retention: "bg-red-100 text-red-700",
19
+ Engagement: "bg-blue-100 text-blue-700",
20
+ Progress: "bg-green-100 text-green-700",
21
+ Events: "bg-purple-100 text-purple-700",
22
+ Operations: "bg-amber-100 text-amber-700",
23
+ };
24
+
25
+ export default function AIActionPlan({ actions }) {
26
+ return (
27
+ <div className="bg-white border border-stone-200 rounded-xl p-4 shadow-sm">
28
+ <div className="flex items-center gap-2 mb-4">
29
+ <Target className="w-5 h-5 text-purple-600" />
30
+ <h3 className="font-semibold text-stone-900">AI Action Plan</h3>
31
+ </div>
32
+ <div className="space-y-3">
33
+ {actions.map((action, idx) => {
34
+ const StatusIcon = statusIcons[action.status] || Circle;
35
+ return (
36
+ <div
37
+ key={idx}
38
+ className="p-3 bg-stone-50 rounded-lg border border-stone-100"
39
+ >
40
+ <div className="flex items-start justify-between gap-2 mb-2">
41
+ <div className="flex-1">
42
+ <div className="flex items-center gap-2 mb-1">
43
+ <StatusIcon
44
+ className={`w-4 h-4 ${
45
+ statusColors[action.status]?.split(" ")[0] || "text-stone-500"
46
+ }`}
47
+ />
48
+ <span className="font-medium text-sm text-stone-900">
49
+ {action.title}
50
+ </span>
51
+ </div>
52
+ <p className="text-xs text-stone-600">{action.description}</p>
53
+ </div>
54
+ <div className="flex flex-col items-end gap-1">
55
+ <span
56
+ className={`text-xs px-2 py-0.5 rounded-full ${
57
+ categoryColors[action.category] || "bg-stone-100 text-stone-700"
58
+ }`}
59
+ >
60
+ {action.category}
61
+ </span>
62
+ <div className="flex items-center gap-1">
63
+ {[...Array(5)].map((_, i) => (
64
+ <div
65
+ key={i}
66
+ className={`w-1.5 h-1.5 rounded-full ${
67
+ i < action.impact
68
+ ? "bg-purple-500"
69
+ : "bg-stone-200"
70
+ }`}
71
+ />
72
+ ))}
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ );
78
+ })}
79
+ </div>
80
+ </div>
81
+ );
82
+ }
83
+