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

Create AIRetentionStrategy.jsx

Browse files
frontend/src/components/admin/AIRetentionStrategy.jsx ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // frontend/src/components/admin/AIRetentionStrategy.jsx
2
+ import React from "react";
3
+ import { Mail, Gift, Phone, TrendingUp, AlertCircle, Users } from "lucide-react";
4
+
5
+ const typeIcons = {
6
+ retention: AlertCircle,
7
+ acquisition: Users,
8
+ payment: TrendingUp,
9
+ };
10
+
11
+ const typeColors = {
12
+ retention: "bg-red-50 border-red-200",
13
+ acquisition: "bg-green-50 border-green-200",
14
+ payment: "bg-amber-50 border-amber-200",
15
+ };
16
+
17
+ const actionIcons = {
18
+ email: Mail,
19
+ offer: Gift,
20
+ call: Phone,
21
+ schedule: Phone,
22
+ };
23
+
24
+ export default function AIRetentionStrategy({ strategy }) {
25
+ const TypeIcon = typeIcons[strategy.type] || AlertCircle;
26
+
27
+ return (
28
+ <div
29
+ className={`bg-white border rounded-xl p-4 shadow-sm ${typeColors[strategy.type] || "border-stone-200"}`}
30
+ >
31
+ <div className="flex items-start gap-3 mb-3">
32
+ <div className={`p-2 rounded-lg ${typeColors[strategy.type]?.replace("50", "100") || "bg-stone-100"}`}>
33
+ <TypeIcon className="w-5 h-5 text-stone-700" />
34
+ </div>
35
+ <div className="flex-1">
36
+ <h3 className="font-semibold text-stone-900 mb-1">{strategy.title}</h3>
37
+ <p className="text-xs text-stone-600 mb-2">{strategy.subtitle}</p>
38
+ </div>
39
+ </div>
40
+ <p className="text-sm text-stone-700 mb-3">{strategy.description}</p>
41
+ <div className="mb-3">
42
+ <div className="text-xs font-medium text-stone-600 mb-1">Members:</div>
43
+ <div className="flex flex-wrap gap-1">
44
+ {strategy.members.map((member, idx) => (
45
+ <span
46
+ key={idx}
47
+ className="text-xs px-2 py-0.5 bg-white rounded border border-stone-200 text-stone-700"
48
+ >
49
+ {member}
50
+ </span>
51
+ ))}
52
+ </div>
53
+ </div>
54
+ <div className="mb-3">
55
+ <div className="text-xs font-medium text-stone-600 mb-2">Suggested Actions:</div>
56
+ <div className="flex flex-wrap gap-2">
57
+ {strategy.suggestedActions.map((action, idx) => {
58
+ const ActionIcon = actionIcons[action.type] || Mail;
59
+ return (
60
+ <button
61
+ key={idx}
62
+ type="button"
63
+ className="inline-flex items-center gap-1 text-xs px-2 py-1 bg-white border border-stone-200 rounded hover:bg-stone-50 text-stone-700"
64
+ >
65
+ <ActionIcon className="w-3 h-3" />
66
+ {action.label}
67
+ </button>
68
+ );
69
+ })}
70
+ </div>
71
+ </div>
72
+ <div className="pt-2 border-t border-stone-200">
73
+ <div className="text-xs font-medium text-green-700">
74
+ Potential Impact: {strategy.potentialImpact}
75
+ </div>
76
+ </div>
77
+ </div>
78
+ );
79
+ }
80
+