From c73116af3c58f8d1a6a08f1ed5bbd6e4d8e70af7 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sun, 18 Jan 2026 17:30:58 +0100 Subject: [PATCH] feat(analytics): replace native date select with custom UI component --- app/sites/[id]/page.tsx | 25 +++++++------ components/ui/Select.tsx | 79 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 components/ui/Select.tsx diff --git a/app/sites/[id]/page.tsx b/app/sites/[id]/page.tsx index 280b81d..fab21f2 100644 --- a/app/sites/[id]/page.tsx +++ b/app/sites/[id]/page.tsx @@ -7,6 +7,7 @@ import { getStats, getRealtime, getDailyStats, getTopPages, getTopReferrers, get import { formatNumber, formatDuration, getDateRange } from '@/lib/utils/format' import { toast } from 'sonner' import LoadingOverlay from '@/components/LoadingOverlay' +import Select from '@/components/ui/Select' import ContentStats from '@/components/dashboard/ContentStats' import TopReferrers from '@/components/dashboard/TopReferrers' import Locations from '@/components/dashboard/Locations' @@ -161,7 +162,7 @@ export default function SiteDashboardPage() {
- + options={[ + { value: 'today', label: 'Today' }, + { value: '7', label: 'Last 7 days' }, + { value: '30', label: 'Last 30 days' }, + { value: 'custom', label: 'Custom' }, + ]} + /> + + {isOpen && ( +
+ {options.map((option) => ( + + ))} +
+ )} +
+ ) +}