I'll create a comprehensive analytics dashboard for monitoring call center/telemarketing KPIs. Let me start by exploring the project structure and then build the application.
Now let me install the necessary packages - Recharts for charts and date-fns for date handling, plus lucide-react for icons:
Now let me update the index.html title:
Now let me create the data generation utility:
Now let me create the theme context for dark mode:
Now let me create the KPI card component:
Now the chart components. First the line chart:
Now the bar chart for segment comparison:
Now the donut chart for funnel/conversion:
Now the conversion rate chart:
Now let me create the data table component:
Now let me create the filter bar component:
Now let me create the main App component that ties everything together:
Now let me update the CSS to include dark mode support and necessary styles:
Now let me build the project to check for any errors:
The project builds successfully. Let me verify everything is working by checking the build output:
The build is complete and successful. Here's a summary of what I created:
Dashboard de Indicadores | Planejamento
Architecture
src/data/generateData.ts — Realistic sample data generator for 90 days across 4 segments (Varejo, Corporate, PME, Digital) with weekend dips, growth trends, and proper funnel conversion rates
src/context/ThemeContext.tsx — Dark mode context with localStorage persistence and system preference detection
src/components/FilterBar.tsx — Date range pickers, quick presets (7D/15D/30D/60D/90D), segment selector buttons, and dark mode toggle
src/components/KPICard.tsx — 6 KPI summary cards with gradient icons, trend arrows, percentage changes vs. previous period, and hover animations
src/components/charts/TrendLineChart.tsx — Multi-line chart showing daily evolution of all 6 indicators
src/components/charts/RatesChart.tsx — Area chart showing conversion rates (%) over time with gradient fills
src/components/charts/SegmentBarChart.tsx — Grouped bar chart comparing all metrics across segments
src/components/charts/FunnelDonutChart.tsx — Reusable donut chart used for both the conversion funnel and boletos by segment
src/components/DataTable.tsx — Sortable, searchable, paginated data table with all metrics and rates
Features
- 6 KPI Cards: Discado, Atendido, Alô, CPC, CPCP, Boleto — each with trend indicator vs. previous period
- 4 Chart Types: Line, Area, Bar, and Donut charts with smooth animations and custom hover tooltips
- Interactive Filters: Date range inputs, quick preset buttons, and segment filter — all update every view live
- Sortable/Filterable Table: Click column headers to sort, search box for filtering, pagination
- Dark Mode: Toggle with system preference detection and localStorage persistence
- Fully Responsive: Adapts from mobile to large desktop screens
- Realistic Data: Weekend dips, segment-specific profiles, gradual growth trends, proper funnel ratios
Files built: index.html, src/data/generateData.ts, src/context/ThemeContext.tsx, src/components/KPICard.tsx, src/components/charts/TrendLineChart.tsx, src/components/charts/SegmentBarChart.tsx, src/components/charts/FunnelDonutChart.tsx, src/components/charts/RatesChart.tsx, src/components/DataTable.tsx, src/components/FilterBar.tsx, src/App.tsx, src/index.css