- {/* عنوان کارت */}
-
-
- {s.shortLabel}
- {s.label}
-
+ {stats.map((s) => {
+ const isClickable = Boolean(s.key && onFilterChange);
+ const isActive = s.key && activeFilter === s.key;
- {/* آیکون در دسکتاپ */}
-
-
-
-
-
- {/* مقدار عددی به همراه واحد روز */}
+ return (
handleClick(s.key)}
+ className={`rounded-xl border p-2 text-center transition-all sm:rounded-lg sm:p-3.5 sm:text-right ${
+ isClickable ? "cursor-pointer select-none" : ""
+ } ${
+ isActive
+ ? "border-accent ring-2 ring-accent/20 bg-accent/5 shadow-sm"
+ : "border-line bg-panel hover:border-accent/40"
+ }`}
>
-
{s.value}
- {s.unit && (
-
- {s.unit}
+ {/* عنوان کارت */}
+
+
+ {s.shortLabel}
+ {s.label}
- )}
+
+ {/* آیکون در دسکتاپ */}
+
+
+
+
+
+ {/* مقدار عددی به همراه واحد روز */}
+
+ {s.value}
+ {s.unit && (
+
+ {s.unit}
+
+ )}
+
-
- ))}
+ );
+ })}