Bổ sung khoảng cách trống 60% mới scroll line + bổ sung last 72h

This commit is contained in:
Truong Vo 2025-12-01 16:16:49 +07:00
parent 9c38adb69e
commit 3e1ad11e72
1 changed files with 7 additions and 3 deletions

View File

@ -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 */}
<Box style={{ height: "200px" }} />
<Box style={{ height: "700px" }} />
</>
) : (
<Flex