refactor(admin): simplify AdminHeader component by removing inline logic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { getWidgets } from '../registry.js';
|
||||
import AdminHeader from '../components/AdminHeader.js';
|
||||
|
||||
export default function DashboardPage({ stats }) {
|
||||
const loading = stats === null || stats === undefined;
|
||||
@@ -8,10 +9,7 @@ export default function DashboardPage({ stats }) {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 sm:gap-6 lg:gap-8">
|
||||
<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>
|
||||
<AdminHeader title="Tableau de bord" description="Vue d'ensemble de votre application" />
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-4 sm:gap-6">
|
||||
{widgets.map(({ id, Component }) => (
|
||||
<Component key={id} data={loading ? null : (stats[id] ?? null)} loading={loading} />
|
||||
|
||||
Reference in New Issue
Block a user