'use client'; import { useState } from 'react'; import { useRealtimeInvalidation } from '@/hooks/use-realtime-invalidation'; import { PageHeader } from '@/components/shared/page-header'; import { KpiCardsWithBoundary } from './kpi-cards'; import { ActivityFeed } from './activity-feed'; import { DateRangePicker } from './date-range-picker'; import { PipelineFunnelChart } from './pipeline-funnel-chart'; import { OccupancyTimelineChart } from './occupancy-timeline-chart'; import { RevenueBreakdownChart } from './revenue-breakdown-chart'; import { LeadSourceChart } from './lead-source-chart'; import { MyRemindersRail } from './my-reminders-rail'; import { WidgetErrorBoundary } from './widget-error-boundary'; import { AlertRail } from '@/components/alerts/alert-rail'; import type { DateRange } from '@/lib/services/analytics.service'; const RANGE_LABELS: Record = { today: 'Today', '7d': 'Last 7 days', '30d': 'Last 30 days', '90d': 'Last 90 days', }; export function DashboardShell() { const [range, setRange] = useState('30d'); useRealtimeInvalidation({ 'interest:stageChanged': [ ['analytics', 'pipeline_funnel', range], ['analytics', 'lead_source_attribution', range], ['dashboard', 'kpis'], ], 'client:created': [['dashboard', 'kpis']], 'berth:statusChanged': [ ['analytics', 'occupancy_timeline', range], ['dashboard', 'kpis'], ], }); return (
{RANGE_LABELS[range]}} variant="gradient" actions={} />
); }