refactor: reorganize feature modules with consistent naming conventions and flattened structure
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
'use client';
|
||||
|
||||
import { getClientWidgets } from '../../dashboard/clientRegistry.js';
|
||||
import '../../dashboard/widgets/index.client.js';
|
||||
import '../../../dashboard.client.js';
|
||||
|
||||
// Évalué après tous les imports : les auto-registrations sont complètes
|
||||
const sortedWidgets = getClientWidgets();
|
||||
|
||||
export default function DashboardPage({ stats }) {
|
||||
const loading = stats === null || stats === undefined;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 sm:gap-6 lg:gap-8">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-lg sm:text-xl font-semibold text-neutral-900 dark:text-white">
|
||||
Tableau de bord
|
||||
</h1>
|
||||
<p className="mt-1 text-[13px] text-neutral-500 dark:text-neutral-400">Vue d'ensemble de votre application</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-4 sm:gap-6">
|
||||
{sortedWidgets.map(({ id, Component }) => (
|
||||
<Component
|
||||
key={id}
|
||||
data={loading ? null : (stats[id] ?? null)}
|
||||
loading={loading}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user