Seth0330 commited on
Commit
964fb13
·
verified ·
1 Parent(s): 07324f5

Create frontend/src/components/admin/AIInsightBox.jsx

Browse files
frontend/src/components/admin/AIInsightBox.jsx ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // frontend/src/components/admin/AIInsightBox.jsx
2
+ import React from "react";
3
+
4
+ export default function AIInsightBox({ memberships }) {
5
+ const total = memberships.length;
6
+ const active = memberships.filter((m) => m.status === "active").length;
7
+ const expired = memberships.filter((m) => m.status === "expired").length;
8
+
9
+ return (
10
+ <div className="mb-8 bg-white border border-stone-200 rounded-2xl p-4 sm:p-5 shadow-sm">
11
+ <div className="flex flex-col sm:flex-row justify-between gap-3 sm:gap-4">
12
+ <div>
13
+ <h2 className="text-sm font-semibold text-stone-900">
14
+ Quick membership insight
15
+ </h2>
16
+ <p className="text-xs text-stone-500 mt-1">
17
+ This section will later be powered by the AI assistant, but for now
18
+ it shows a quick snapshot of your dojo.
19
+ </p>
20
+ </div>
21
+ <div className="flex flex-wrap gap-3 text-xs">
22
+ <div className="px-3 py-2 rounded-lg bg-stone-50 border border-stone-200">
23
+ <div className="text-stone-500">Total members</div>
24
+ <div className="font-semibold text-stone-900">{total}</div>
25
+ </div>
26
+ <div className="px-3 py-2 rounded-lg bg-emerald-50 border border-emerald-100">
27
+ <div className="text-emerald-700 text-[11px]">Active</div>
28
+ <div className="font-semibold text-emerald-800">{active}</div>
29
+ </div>
30
+ <div className="px-3 py-2 rounded-lg bg-rose-50 border border-rose-100">
31
+ <div className="text-rose-700 text-[11px]">Expired</div>
32
+ <div className="font-semibold text-rose-800">{expired}</div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ );
38
+ }