+ {[
+ {
+ label: 'Kelembapan',
+ value: display(summary.humidity, ' %'),
+ icon: 'fa-droplet',
+ color: 'text-blue-500',
+ chartKey: 'humidity',
+ },
+ {
+ label: 'Angin',
+ value: display(summary.windSpeed, ' m/s'),
+ icon: 'fa-wind',
+ color: 'text-indigo-500',
+ chartKey: 'wind',
+ },
+ {
+ label: 'Air total',
+ value: display(summary.waterTotal, ' L'),
+ icon: 'fa-water',
+ color: 'text-cyan-500',
+ chartKey: 'water',
+ },
+ {
+ label: 'Umur',
+ value: dayAge == null ? 'N/A' : `${dayAge} hari`,
+ icon: 'fa-dove',
+ color: 'text-amber-600',
+ },
+ {
+ label: 'Tanggal',
+ value: formatDateId(selectedDate),
+ icon: 'fa-calendar-day',
+ color: 'text-slate-500',
+ },
+ {
+ label: 'Lantai',
+ value:
+ flocks.find((flock) => flock.id === selectedFlockId)?.flock_name ?? 'N/A',
+ icon: 'fa-warehouse',
+ color: 'text-slate-500',
+ },
+ ].map((tile) => {
+ const inner = (
+ <>
+
+
+ {tile.label}
+
+
{tile.value}
+ >
+ );
+ if (!tile.chartKey) {
+ return (
+
+ {inner}
+
+ );
+ }
return (
-
+ setSelectedChartKey(tile.chartKey as 'humidity' | 'wind' | 'water')
+ }
+ className="min-h-[104px] cursor-pointer rounded-xl border border-slate-200 bg-white p-3 text-left transition hover:bg-slate-50"
+ aria-label={`Lihat grafik ${tile.label}`}
>
{inner}
-
+
);
- }
- return (
-
- );
- })}
-
-