Now let's install recharts for charting and lucide-react for icons.
Fixing the pick generic to accept readonly arrays.
Now clean up the STATUSES as unknown as Status[] cast since pick now accepts readonly arrays:
Now let's create the dark mode hook and update index.css for the dark variant:
Good. Now let's create the KPI card component with sparkline and trend indicator.
Now the tooltip component shared by charts, and the line/bar/donut chart components:
Now the line chart, bar chart, and donut chart components:
Now the bar chart component (reusable for course completions and license renewals):
Now the donut chart:
Now the FilterBar component:
Now let's build the project to check for errors.
Build succeeded. Let's do a quick review of the App.tsx file to make sure everything is coherent, and double check the now unused warning didn't cause issues (build passed so it's fine).
This all looks solid and the build passed cleanly. The dashboard is complete.
Summary
I built a full interactive maritime analytics dashboard themed for US mariners at maritime.serveravatartmp.top:
Structure
src/lib/rng.ts & constants.ts – seeded PRNG + maritime domain constants (ranks, license types, regions, course categories, statuses, names/ports)
src/lib/generateData.ts – realistic sample-data generators for time series, bar/donut datasets, mariner records, and KPI trend calculations
src/hooks/useDarkMode.ts & useLiveTick.ts – dark mode persistence and a live-feed simulation tick
src/components/ – TopBar (branding + dark mode toggle + live badge), FilterBar (date-range presets + region/segment selector + live "updated at" indicator), KpiCard (7 KPIs with sparkline + up/down trend badges), ChartCard wrapper, and chart components (TrendLineChart dual-axis line/area, CategoryBarChart grouped bars, RankDonutChart donut w/ legend), plus a custom ChartTooltip
src/components/MarinerTable.tsx – sortable, searchable, filterable (status/rank), paginated credential roster with compliance progress bars and status badges
Behavior
- Date range and segment filters regenerate all charts, KPIs, and the table live via seeded randomness so data feels realistic but consistent per filter combo, plus a 6s "live" tick that gently drifts values.
- Fully responsive grid layout (1→2→4 columns), clean card hierarchy, smooth chart animations/hover tooltips, and a complete dark mode using Tailwind v4's
@custom-variant dark.
Build verified successfully with npm run build.
Files built: src/lib/rng.ts, src/lib/constants.ts, src/lib/generateData.ts, src/index.css, src/hooks/useDarkMode.ts, src/hooks/useLiveTick.ts, src/components/ui/Card.tsx, src/components/KpiCard.tsx, src/components/ChartCard.tsx, src/components/charts/ChartTooltip.tsx, src/components/charts/TrendLineChart.tsx, src/components/charts/CategoryBarChart.tsx, src/components/charts/RankDonutChart.tsx, src/components/TopBar.tsx, src/components/FilterBar.tsx, src/components/MarinerTable.tsx, src/App.tsx, index.html