I'll create an interactive crypto scam analytics dashboard. Let me start by exploring the project structure.
I have a good understanding. I'll build a comprehensive crypto scam analytics dashboard with custom SVG charts (no chart library needed for full control over tooltips/transitions). Let me start with the data generation and utilities.
First, updating the title:
Now let me create the data generation module with realistic sample crypto scam data.
Now let me create the theme context and shared UI helpers.
Now the chart components. Let me create the LineChart with hover tooltips and smooth animation.
Now let me create the KPI card, filter controls, and data table components.
Now the data table with sorting and the filter bar:
Now the filter bar component with date-range and segment filters:
Now the main App with all data aggregation logic wiring everything together live.
The LineChart uses useMemo for a ResizeObserver which isn't ideal. Let me fix that with a proper useEffect and callback ref pattern.
The lint error was from a race between the two edits; the second edit fixed it. Let me verify the file and build.
Now let me build the project to confirm everything compiles.
The build succeeded. Let me do a final review of the KpiCard's delta formatting which had a redundant expression.
The build succeeds cleanly. I've built ScamWatch, a fully interactive crypto scam analytics dashboard. Here's what it includes:
Features Delivered
KPI Summary Cards (4) — Total Losses, Scam Reports, Victims Affected, and Funds Recovered. Each shows:
- Live values that update with filters
- Trend indicators with percentage change vs. the previous equivalent period (red = worsening for scam metrics, green = improving; inverted logic for "Funds Recovered")
- Inline sparklines drawn from the actual filtered daily data
Charts (all custom-built SVG with hover tooltips & smooth transitions)
- Line chart — Losses vs. Recovered over time, with animated line-draw, gradient area fills, a crosshair, and a floating multi-series tooltip
- Donut chart — Scam type breakdown with interactive segments, hover-driven center readout, and a percentage legend
- Two bar charts — Losses by blockchain and average loss per incident category, with animated bar growth and per-bar tooltips
Sortable & Filterable Data Table — Click any column to sort (with direction indicator), full-text search across cases, severity/status color badges, and pagination.
Live Filters — A date-range toggle (7D/30D/90D/1Y) plus scam-type, chain, and severity segment dropdowns. Every KPI, chart, and the table recompute instantly (via useMemo), with an "active segments" chip bar and a clear button.
Design & UX
- Dark mode toggle (persisted to localStorage, respects system preference) using Tailwind v4's custom
dark variant
- Clean layout hierarchy, ambient gradient glows, a "live feed" pulse indicator, fade-up entrance animation
- Fully responsive grid that collapses gracefully to a single column on mobile
Realistic Data — A seeded generator produces 365 days of data (~11,000 individual scam cases) with weighted scam types, per-type average losses, severity multipliers, weekly/seasonal patterns, an upward trend, and occasional incident spikes — so every chart feels alive and internally consistent.
Files built: index.html, src/index.css, src/data/generateData.ts, src/hooks/useTheme.ts, src/utils/format.ts, src/components/charts/LineChart.tsx, src/components/charts/BarChart.tsx, src/components/charts/DonutChart.tsx, src/components/KpiCard.tsx, src/components/Card.tsx, src/components/DataTable.tsx, src/components/FilterBar.tsx, src/App.tsx