diff --git a/apps/web/src/app/(app)/[organizationId]/[projectId]/dashboards/[dashboardId]/list-reports.tsx b/apps/web/src/app/(app)/[organizationId]/[projectId]/dashboards/[dashboardId]/list-reports.tsx index cf25f406..2beeb2af 100644 --- a/apps/web/src/app/(app)/[organizationId]/[projectId]/dashboards/[dashboardId]/list-reports.tsx +++ b/apps/web/src/app/(app)/[organizationId]/[projectId]/dashboards/[dashboardId]/list-reports.tsx @@ -1,9 +1,8 @@ 'use client'; -import { useState } from 'react'; import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; +import { useOverviewOptions } from '@/components/overview/useOverviewOptions'; import { LazyChart } from '@/components/report/chart/LazyChart'; -import { ReportRange } from '@/components/report/ReportRange'; import { Button } from '@/components/ui/button'; import { DropdownMenu, @@ -18,9 +17,13 @@ import { ChevronRight, MoreHorizontal, PlusIcon, Trash } from 'lucide-react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; -import { getDefaultIntervalByRange } from '@mixan/constants'; +import { + getDefaultIntervalByDates, + getDefaultIntervalByRange, +} from '@mixan/constants'; import type { getReportsByDashboardId } from '@mixan/db'; -import type { IChartRange } from '@mixan/validation'; + +import { OverviewReportRange } from '../../overview-sticky-header'; interface ListReportsProps { reports: Awaited>; @@ -29,16 +32,12 @@ interface ListReportsProps { export function ListReports({ reports }: ListReportsProps) { const router = useRouter(); const params = useAppParams<{ dashboardId: string }>(); - const [range, setRange] = useState(null); + const { range, startDate, endDate } = useOverviewOptions(); return ( <> - setRange((p) => (p === value ? null : value))} - /> +