feat(L1): modular widget dashboard — 15 configurable widgets
Replaces monolithic AdminDashboard/ClientDashboard with a per-user configurable widget grid. 15 widget types: ProductionStats, QueueStatus, RecentRenders, CostOverview, WorkerStatus, KPISummary, OrderThroughput, Revenue, ItemStatus, ProcessingTimes, RenderTimeByOutputType, OutputTypeUsage, TopProducts, OrdersByUser, RenderBackendStats. DashboardTimeframeContext provides shared timeframe state. Dashboard config persisted in DB via GET/PUT /api/dashboard/config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
import { useAuthStore } from '../store/auth'
|
||||
import DashboardGrid from '../components/dashboard/DashboardGrid'
|
||||
import AdminDashboard from '../components/dashboard/AdminDashboard'
|
||||
import ClientDashboard from '../components/dashboard/ClientDashboard'
|
||||
|
||||
export default function DashboardPage() {
|
||||
const user = useAuthStore((s) => s.user)
|
||||
const isPrivileged = user?.role === 'admin' || user?.role === 'project_manager'
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
{/* Configurable widget grid — visible to all roles */}
|
||||
<div className="p-8 pb-0">
|
||||
<h1 className="text-2xl font-bold text-content mb-6">Dashboard</h1>
|
||||
<DashboardGrid />
|
||||
</div>
|
||||
|
||||
{/* Role-based analytics section */}
|
||||
{isPrivileged ? <AdminDashboard /> : <ClientDashboard />}
|
||||
<div className="p-8">
|
||||
<h1 className="text-2xl font-bold text-content mb-6">Dashboard</h1>
|
||||
<DashboardGrid />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user