AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
72%
Quality Avg
?
77%
Security Avg
?
64%
Reviews
?
91
Review Result ?
solutionbowl/super-admin · 3e3c93e0
This commit adds a comprehensive dashboard UI with multiple components that display metrics, charts, alerts, insights, and recent activity. The code follows consistent React functional component patterns and uses reusable components like MetricCard and Insights. The UI visual aspects appear well organized with Tailwind CSS classes, and there is a clear separation of concerns. There is limited dynamic data handling: most values are hardcoded. The commit message is minimal and uninformative. Business value is moderate since the dashboard provides useful insights, but the lack of dynamic data integration and backend linkage limits impact. Bug and security risks are low because it is mostly UI, but there is some mild risk if the displayed data is inaccurate or stale. Fake work risk is moderate due to the lack of backend integration or data connection, making this potentially a static prototype.
Quality
?
80%
Security
?
90%
Business Value
?
75%
Maintainability
?
85%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Issue
Where
commit message
Issue / Evidence
issue
Suggested Fix
provide a descriptive commit message to clarify purpose and changes for reviewers
Code Maintainability
Where
src/components/dashboard/dashboard-content.tsx:16
Issue / Evidence
code maintainability
Suggested Fix
replace hardcoded metric values with dynamic props or state from backend/API to improve business value
Code Maintainability
Where
src/components/dashboard/dashboard-content.tsx:25
Issue / Evidence
code maintainability
Suggested Fix
similarly, avoid hardcoded dashboard values; fetch/update metrics dynamically
Clarity
Where
src/components/dashboard/high-loss-alert.tsx:18
Issue / Evidence
clarity
Suggested Fix
replace hardcoded loss percentage with calculated value based on props or context
Data Integrity
Where
src/components/dashboard/insights.tsx:17
Issue / Evidence
data integrity
Suggested Fix
consider sourcing insight data dynamically rather than static array to reflect real-time business insights
Robustness
Where
src/components/dashboard/metric-card.tsx:9
Issue / Evidence
robustness
Suggested Fix
validate trendPercent format to prevent errors or unexpected UI display
Extensibility
Where
src/components/dashboard/metric-card.tsx:12
Issue / Evidence
extensibility
Suggested Fix
consider using a type or enum for iconColor to ensure consistent color usage
Code Change Preview · src/components/dashboard/dashboard-content.tsx
?
Removed / Before Commit
- diff --git a/src/components/dashboard/dashboard-content.tsx b/src/components/dashboard/dashboard-content.tsx - new file mode 100644 - index 0000000..c4cc160
Added / After Commit
+ diff --git a/src/components/dashboard/dashboard-content.tsx b/src/components/dashboard/dashboard-content.tsx + new file mode 100644 + index 0000000..c4cc160 + import { Banknote, ChartNoAxesCombined, CircleDollarSign, Target } from "lucide-react"; + import { MetricCard } from "./metric-card"; + import { SportsProfitLossChart } from "./sports-profit-loss-chart"; + import { SportsExposureChart } from "./sports-exposure-chart"; + import { HighLossAlert } from "./high-loss-alert"; + import { PerformanceTable } from "./performance-table"; + import { RecentActivity } from "./recent-activity"; + import { Insights } from "./insights"; + + export function DashboardContent() { + return ( + <div className="w-full space-y-5"> + <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4"> + <MetricCard + title="Net Profit / Loss"
Removed / Before Commit
- diff --git a/src/components/dashboard/high-loss-alert.tsx b/src/components/dashboard/high-loss-alert.tsx - new file mode 100644 - index 0000000..5bdff6d
Added / After Commit
+ diff --git a/src/components/dashboard/high-loss-alert.tsx b/src/components/dashboard/high-loss-alert.tsx + new file mode 100644 + index 0000000..5bdff6d + import { AlertTriangle } from "lucide-react"; + + interface HighLossAlertProps { + sport: string; + loss: number; + } + + export function HighLossAlert({ sport, loss }: HighLossAlertProps) { + return ( + <div className="flex flex-col gap-4 rounded-xl border border-red-200 bg-red-50 px-5 py-4 shadow-[0_12px_34px_rgba(239,68,68,0.08)] sm:flex-row sm:items-center sm:justify-between"> + <div className="flex items-center gap-4"> + <div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-red-500 text-white shadow-[0_10px_24px_rgba(239,68,68,0.28)]"> + <AlertTriangle className="h-5 w-5" /> + </div> + <div>
Removed / Before Commit
- diff --git a/src/components/dashboard/insights.tsx b/src/components/dashboard/insights.tsx - new file mode 100644 - index 0000000..6df7bcb
Added / After Commit
+ diff --git a/src/components/dashboard/insights.tsx b/src/components/dashboard/insights.tsx + new file mode 100644 + index 0000000..6df7bcb + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + import type { ComponentType } from "react"; + import { ArrowDownRight, ArrowUpRight, Clock3 } from "lucide-react"; + import { cn } from "@/lib/utils"; + + interface Insight { + id: string; + type: "positive" | "negative" | "neutral"; + title: string; + value: string; + description: string; + icon: ComponentType<{ className?: string }>; + } + + const insights: Insight[] = [
Removed / Before Commit
- diff --git a/src/components/dashboard/metric-card.tsx b/src/components/dashboard/metric-card.tsx - new file mode 100644 - index 0000000..e8aac11
Added / After Commit
+ diff --git a/src/components/dashboard/metric-card.tsx b/src/components/dashboard/metric-card.tsx + new file mode 100644 + index 0000000..e8aac11 + import type { ComponentType } from "react"; + import { TrendingDown, TrendingUp } from "lucide-react"; + import { Card, CardContent } from "@/components/ui/card"; + import { cn } from "@/lib/utils"; + + interface MetricCardProps { + title: string; + value: string; + trend?: "up" | "down" | null; + trendPercent?: string; + icon: ComponentType<{ className?: string }>; + iconColor: "green" | "blue" | "violet" | "orange"; + sparkline: number[]; + } +
Removed / Before Commit
- diff --git a/src/components/dashboard/performance-table.tsx b/src/components/dashboard/performance-table.tsx - new file mode 100644 - index 0000000..13b3582
Added / After Commit
+ diff --git a/src/components/dashboard/performance-table.tsx b/src/components/dashboard/performance-table.tsx + new file mode 100644 + index 0000000..13b3582 + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, + } from "@/components/ui/table"; + import { cn } from "@/lib/utils"; + + interface PerformanceData { + sport: string; + icon: string; + pl: number;
Removed / Before Commit
- diff --git a/src/components/dashboard/recent-activity.tsx b/src/components/dashboard/recent-activity.tsx - new file mode 100644 - index 0000000..09b0cca
Added / After Commit
+ diff --git a/src/components/dashboard/recent-activity.tsx b/src/components/dashboard/recent-activity.tsx + new file mode 100644 + index 0000000..09b0cca + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + import type { ComponentType } from "react"; + import { ArrowDownRight, ArrowUpRight, Banknote, CheckCircle2, Clock3 } from "lucide-react"; + import { cn } from "@/lib/utils"; + + interface RecentActivity { + id: string; + type: "profit" | "loss" | "commission" | "exposure" | "settled"; + title: string; + amount: string; + time: string; + icon: ComponentType<{ className?: string }>; + } + + const activities: RecentActivity[] = [
Removed / Before Commit
- diff --git a/src/components/dashboard/sports-exposure-chart.tsx b/src/components/dashboard/sports-exposure-chart.tsx - new file mode 100644 - index 0000000..611647f
Added / After Commit
+ diff --git a/src/components/dashboard/sports-exposure-chart.tsx b/src/components/dashboard/sports-exposure-chart.tsx + new file mode 100644 + index 0000000..611647f + import { Info } from "lucide-react"; + import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip } from "recharts"; + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + + const data = [ + { name: "Soccer", value: 47100, percent: 80.6, fill: "#2f7df4" }, + { name: "Cricket", value: 11350, percent: 19.4, fill: "#f59e0b" }, + ]; + + export function SportsExposureChart() { + return ( + <Card className="rounded-xl border border-slate-200/80 bg-white shadow-[0_12px_34px_rgba(15,23,42,0.05)]"> + <CardHeader className="px-5 pb-1 pt-5"> + <CardTitle className="text-[15px] font-bold text-slate-900">Exposure by Sport</CardTitle> + </CardHeader>
Removed / Before Commit
- diff --git a/src/components/dashboard/sports-profit-loss-chart.tsx b/src/components/dashboard/sports-profit-loss-chart.tsx - new file mode 100644 - index 0000000..16187e9
Added / After Commit
+ diff --git a/src/components/dashboard/sports-profit-loss-chart.tsx b/src/components/dashboard/sports-profit-loss-chart.tsx + new file mode 100644 + index 0000000..16187e9 + import { + Bar, + BarChart, + Cell, + CartesianGrid, + LabelList, + ReferenceLine, + ResponsiveContainer, + Tooltip, + XAxis, + YAxis, + } from "recharts"; + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + + const data = [
Removed / Before Commit
- diff --git a/src/routes/index.tsx b/src/routes/index.tsx - index 3dfed4b..573c475 100644 - import { createFileRoute } from "@tanstack/react-router"; - - export const Route = createFileRoute("/")({ - component: DashboardPage, - }); - - function DashboardPage() { - return ( - <div className="flex min-h-[50vh] items-center justify-center"> - <h1 className="text-3xl font-bold tracking-tight text-foreground">Welcome</h1> - </div> - ); - }
Added / After Commit
+ diff --git a/src/routes/index.tsx b/src/routes/index.tsx + index 3dfed4b..573c475 100644 + import { createFileRoute } from "@tanstack/react-router"; + import { DashboardContent } from "@/components/dashboard/dashboard-content"; + + export const Route = createFileRoute("/")({ + component: DashboardPage, + }); + + function DashboardPage() { + return <DashboardContent />; + }
Removed / Before Commit
- diff --git a/src/routes/master-dashboard.tsx b/src/routes/master-dashboard.tsx - new file mode 100644 - index 0000000..c2f40d3
Added / After Commit
+ diff --git a/src/routes/master-dashboard.tsx b/src/routes/master-dashboard.tsx + new file mode 100644 + index 0000000..c2f40d3 + import { createFileRoute } from "@tanstack/react-router"; + import { DashboardContent } from "@/components/dashboard/dashboard-content"; + + export const Route = createFileRoute("/master-dashboard")({ + component: MasterDashboardPage, + head: () => ({ meta: [{ title: "Master Dashboard - B2B-B2C Panel" }] }), + }); + + function MasterDashboardPage() { + return <DashboardContent />; + }
Removed / Before Commit
- diff --git a/src/routes/super-dashboard.tsx b/src/routes/super-dashboard.tsx - new file mode 100644 - index 0000000..f086f4b
Added / After Commit
+ diff --git a/src/routes/super-dashboard.tsx b/src/routes/super-dashboard.tsx + new file mode 100644 + index 0000000..f086f4b + import { createFileRoute } from "@tanstack/react-router"; + import { DashboardContent } from "@/components/dashboard/dashboard-content"; + + export const Route = createFileRoute("/super-dashboard")({ + component: SuperDashboardPage, + head: () => ({ meta: [{ title: "Super Dashboard - B2B-B2C Panel" }] }), + }); + + function SuperDashboardPage() { + return <DashboardContent />; + }
Removed / Before Commit
- diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts - index c2262f4..cfc24f3 100644 - import { Route as UploadFilesRouteImport } from './routes/upload-files' - import { Route as TransferStatementRouteImport } from './routes/transfer-statement' - import { Route as TransferRouteImport } from './routes/transfer' - import { Route as StatementRouteImport } from './routes/statement' - import { Route as SettingsRouteImport } from './routes/settings' - import { Route as ReportsRouteImport } from './routes/reports' - import { Route as NetExposureDetailRouteImport } from './routes/net-exposure-detail' - import { Route as NetExposureBetRouteImport } from './routes/net-exposure-bet' - import { Route as NetExposureRouteImport } from './routes/net-exposure' - import { Route as MarketingRouteImport } from './routes/marketing' - import { Route as LoginRouteImport } from './routes/login' - import { Route as FormulaCenterRouteImport } from './routes/formula-center' - path: '/transfer', - getParentRoute: () => rootRouteImport, - } as any) - const StatementRoute = StatementRouteImport.update({
Added / After Commit
+ diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts + index c2262f4..cfc24f3 100644 + import { Route as UploadFilesRouteImport } from './routes/upload-files' + import { Route as TransferStatementRouteImport } from './routes/transfer-statement' + import { Route as TransferRouteImport } from './routes/transfer' + import { Route as SuperDashboardRouteImport } from './routes/super-dashboard' + import { Route as StatementRouteImport } from './routes/statement' + import { Route as SettingsRouteImport } from './routes/settings' + import { Route as ReportsRouteImport } from './routes/reports' + import { Route as NetExposureDetailRouteImport } from './routes/net-exposure-detail' + import { Route as NetExposureBetRouteImport } from './routes/net-exposure-bet' + import { Route as NetExposureRouteImport } from './routes/net-exposure' + import { Route as MasterDashboardRouteImport } from './routes/master-dashboard' + import { Route as MarketingRouteImport } from './routes/marketing' + import { Route as LoginRouteImport } from './routes/login' + import { Route as FormulaCenterRouteImport } from './routes/formula-center' + path: '/transfer', + getParentRoute: () => rootRouteImport,
Removed / Before Commit
- diff --git a/src/services/api/authService.ts b/src/services/api/authService.ts - index 03bb8a8..e579034 100644 - return normalizeUser(rawUser, data.permissions ?? root.permissions); - } - - function readJson<T>(key: string): T | null { - if (!isBrowser()) return null; - try { - - export const authService = { - async login(credentials: LoginRequest): Promise<LoginResult> { - const payload = await authApiClient.post<unknown>("/auth/login", credentials, { auth: false }); - const result = extractLoginResult(payload); - writeAuth(result.token, result.user);
Added / After Commit
+ diff --git a/src/services/api/authService.ts b/src/services/api/authService.ts + index 03bb8a8..e579034 100644 + return normalizeUser(rawUser, data.permissions ?? root.permissions); + } + + // Demo mode for testing + function createDemoUser(username: string): AuthUser { + return { + id: "demo-user-1", + username, + email: `${username}@example.com`, + role: "owner", + userRole: "owner", + permissions: [ + "dashboard", + "view_dashboard", + "view_reports", + "view_users",