I'll build a comprehensive analytics dashboard with all the requested features. Let me start by exploring the project structure and then create the implementation.
Now I'll install the necessary packages and build the dashboard. Let me install Recharts for charts and lucide-react for icons.
Now let me create all the files. Starting with the sample data generator:
Let me fix the unused variable:
Now let me create the KPI Cards component:
Now let me create the Charts Section:
Now let me create the Filters component:
Now let me create the DataTable component:
I need to move the import to the top of the file. Let me fix that:
Now let me create the Dark Mode Toggle and Header:
Now let me create the main App.tsx that ties everything together:
Now let me update the index.html title and add some custom CSS:
Now let me build the project to check for any errors:
The project builds successfully. Let me do a quick review of the key files to make sure everything is properly connected:
All files are properly set up. Let me verify the complete App.tsx is clean:
The project builds successfully. Here's a summary of what I built:
A Lead Automation — Analytics Dashboard
Architecture (6 component files + 1 data file)
src/App.tsx — Main dashboard with dark mode state, filter state management, and memoized data computation
src/data/sampleData.ts — Generates 200 realistic leads with weighted status distribution, segment-specific company names, and varied deal sizes
src/components/Header.tsx — Sticky header with logo, live indicator, and animated dark mode toggle
src/components/KPICards.tsx — 6 KPI cards with gradient icons, trend indicators (up/down with percentages), and hover effects
src/components/ChartsSection.tsx — 5 charts: Area chart (monthly trends), Bar charts (segment revenue + daily activity), Donut charts (lead sources + pipeline stages)
src/components/DataTable.tsx — Sortable/paginated table with avatar initials, status badges, score progress bars, and responsive column visibility
src/components/Filters.tsx — Search input, segment dropdown, status dropdown, 5 date presets (7/30/90/365 days + All Time), and clear button
Features
- ✅ 6 KPI cards: Total Leads, Conversion Rate, Total Revenue, Avg Deal Size, Qualified Rate, Pipeline Value — all with animated trend badges
- ✅ 5 interactive charts with custom hover tooltips, smooth gradient fills, and proper legends
- ✅ Sortable data table with multi-column sorting, pagination, and empty state
- ✅ 4 filter types: text search (name/email/company), segment, status, and date range presets — all updating every view live
- ✅ Dark mode with smooth animated transitions between themes
- ✅ Fully responsive: mobile-first grid layout, responsive table columns hidden by breakpoints
- ✅ Realistic data: weighted status distribution, segment-appropriate companies and deal sizes, score-based lead quality
Files built: src/data/sampleData.ts, src/components/KPICards.tsx, src/components/ChartsSection.tsx, src/components/Filters.tsx, src/components/DataTable.tsx, src/components/Header.tsx, src/App.tsx, index.html, src/index.css