'use client';

import { lazy, Suspense } from 'react';
import { AppShell } from '@/components/layouts/AppShell/AppShell';
import { ProtectedRoute } from '@/components/common/ProtectedRoute';
import { LoadingFallback } from '@/components/common/LoadingFallback';

// Lazy load the unified insights dashboard component with tabs
const UnifiedInsightsDashboard = lazy(() =>
  import('@/components/features/analytics/UnifiedInsightsDashboard').then((mod) => ({
    default: mod.UnifiedInsightsDashboard,
  }))
);

export default function InsightsPage() {
  return (
    <ProtectedRoute>
      <AppShell>
        <Suspense fallback={<LoadingFallback variant="page" />}>
          <UnifiedInsightsDashboard />
        </Suspense>
      </AppShell>
    </ProtectedRoute>
  );
}
