From 3e1ad11e721af7519c9acb57cb23ccf5e661bf7b Mon Sep 17 00:00:00 2001 From: Truong Vo <41848815+vmtruong301296@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:16:49 +0700 Subject: [PATCH] =?UTF-8?q?B=E1=BB=95=20sung=20kho=E1=BA=A3ng=20c=C3=A1ch?= =?UTF-8?q?=20tr=E1=BB=91ng=2060%=20m=E1=BB=9Bi=20scroll=20line=20+=20b?= =?UTF-8?q?=E1=BB=95=20sung=20last=2072h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FRONTEND/src/components/ModalHistory.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FRONTEND/src/components/ModalHistory.tsx b/FRONTEND/src/components/ModalHistory.tsx index 8b2faf5..f49a23e 100644 --- a/FRONTEND/src/components/ModalHistory.tsx +++ b/FRONTEND/src/components/ModalHistory.tsx @@ -35,11 +35,12 @@ interface ModalHistoryProps { } const TIME_PERIODS = [ - { label: "Current", value: "current" }, + { label: "Latest", value: "current" }, { label: "last 4h", value: "last_4h" }, { label: "last 8h", value: "last_8h" }, { label: "last 24h", value: "last_24h" }, { label: "last 48h", value: "last_48h" }, + { label: "last 72h", value: "last_72h" }, ]; function ModalHistory({ @@ -125,6 +126,9 @@ function ModalHistory({ case "last_48h": // Last 48h: tất cả data (từ đầu đến giờ) return [now - 48 * HOUR, now]; + case "last_72h": + // Last 72h: dữ liệu trong 72h gần nhất + return [now - 72 * HOUR, now]; default: return [0, now]; } @@ -380,7 +384,7 @@ function ModalHistory({ {/* Các items trong nhóm */} {items - ?.filter((el, i) => + ?.filter((_, i) => activeTimePeriod === "current" ? i === 0 : true @@ -450,7 +454,7 @@ function ModalHistory({ ))} {/* Spacer để đảm bảo có thể scroll ngay cả khi content ít */} - + ) : (