Update frontend/src/components/admin/OverviewCard.jsx
Browse files
frontend/src/components/admin/OverviewCard.jsx
CHANGED
|
@@ -4,15 +4,22 @@ import React from "react";
|
|
| 4 |
const colorMap = {
|
| 5 |
blue: "bg-blue-50 text-blue-700",
|
| 6 |
amber: "bg-amber-50 text-amber-700",
|
| 7 |
-
red: "bg-
|
| 8 |
green: "bg-emerald-50 text-emerald-700",
|
| 9 |
};
|
| 10 |
|
| 11 |
-
export default function OverviewCard({ title, value, icon: Icon, color, trend }) {
|
| 12 |
const badgeClasses = colorMap[color] || "bg-slate-50 text-slate-700";
|
|
|
|
| 13 |
|
| 14 |
return (
|
| 15 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<div className="flex items-start justify-between gap-3">
|
| 17 |
<div>
|
| 18 |
<div className="text-xs font-medium text-stone-500 uppercase tracking-wide mb-1">
|
|
|
|
| 4 |
const colorMap = {
|
| 5 |
blue: "bg-blue-50 text-blue-700",
|
| 6 |
amber: "bg-amber-50 text-amber-700",
|
| 7 |
+
red: "bg-rose-50 text-rose-700",
|
| 8 |
green: "bg-emerald-50 text-emerald-700",
|
| 9 |
};
|
| 10 |
|
| 11 |
+
export default function OverviewCard({ title, value, icon: Icon, color, trend, onClick }) {
|
| 12 |
const badgeClasses = colorMap[color] || "bg-slate-50 text-slate-700";
|
| 13 |
+
const clickable = !!onClick;
|
| 14 |
|
| 15 |
return (
|
| 16 |
+
<div
|
| 17 |
+
onClick={onClick}
|
| 18 |
+
className={
|
| 19 |
+
"bg-white border border-stone-200 rounded-2xl p-4 shadow-sm flex flex-col justify-between transition-shadow " +
|
| 20 |
+
(clickable ? "cursor-pointer hover:shadow-md" : "")
|
| 21 |
+
}
|
| 22 |
+
>
|
| 23 |
<div className="flex items-start justify-between gap-3">
|
| 24 |
<div>
|
| 25 |
<div className="text-xs font-medium text-stone-500 uppercase tracking-wide mb-1">
|