From 0374a67335d2cfd32608c0cbe4aa4311b06b3cd5 Mon Sep 17 00:00:00 2001 From: Alberto-Audrix Date: Tue, 22 Sep 2026 11:54:29 +0700 Subject: [PATCH] add table for data history and remove x count of data readings on panel iot --- components/IotPanelPage.tsx | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/components/IotPanelPage.tsx b/components/IotPanelPage.tsx index 32c1a55..5d92859 100644 --- a/components/IotPanelPage.tsx +++ b/components/IotPanelPage.tsx @@ -308,13 +308,7 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => { className="rounded-lg border border-slate-300 bg-white px-2 py-1.5 text-sm text-slate-700 focus:ring-2 focus:ring-red-500 focus:border-red-500" /> - - {summary - ? `${summary.count} pembacaan` - : dates.length === 0 - ? 'Belum ada tanggal dengan data IoT' - : 'Tidak ada pembacaan pada tanggal ini'} - + )} @@ -561,6 +555,41 @@ const IotPanelPage: React.FC<{ onSettings: () => void }> = ({ onSettings }) => { ))} + {selectedFlockId != null && dayRows.length > 0 && ( +
+

+ + Data Histori Panel IoT · {formatDateId(selectedDate)} +

+
+ + + + + + + + + + + + + {dayRows.map((row) => ( + + + + + + + + + ))} + +
WaktuSuhu Rata-rataExperience SuhuKelembapanAnginAir Total
{formatTime(row.timestamp)}{formatNumber(row.average_temperature)} °C{formatNumber(row.experience_temperature)} °C{formatNumber(row.humidity)} %{formatNumber(row.wind_speed)} m/s{formatNumber(row.water_total)} L
+
+
+ )} + {selectedChartKey && (() => { const chart = SECONDARY_CHARTS.find((item) => item.key === selectedChartKey)!;