From 7e40c2e391a82f898982bfbc6d52a4e0c7a0cbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Sat, 28 Oct 2023 22:07:37 +0200 Subject: [PATCH] add range on dashboard --- .../[organization]/[project]/[dashboard].tsx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/apps/web/src/pages/[organization]/[project]/[dashboard].tsx b/apps/web/src/pages/[organization]/[project]/[dashboard].tsx index 8134ed69..7afb398c 100644 --- a/apps/web/src/pages/[organization]/[project]/[dashboard].tsx +++ b/apps/web/src/pages/[organization]/[project]/[dashboard].tsx @@ -7,6 +7,7 @@ import { useOrganizationParams } from "@/hooks/useOrganizationParams"; import { Suspense, useMemo } from "react"; import { createServerSideProps } from "@/server/getServerSideProps"; import { Chart } from "@/components/report/chart"; +import { timeRanges } from "@/utils/constants"; export const getServerSideProps = createServerSideProps() @@ -29,22 +30,26 @@ export default function Dashboard() { {dashboard?.name}
- {reports.map((report) => ( -
- { + const range = timeRanges.find((item) => item.range === report.range) + return ( +
- {report.name} - -
- + +
{report.name}
+ {range &&
{range.title}
} + +
+ +
-
- ))} + ) + })}