feat(core)!: introduce runtime extension registry and flat module conventions
BREAKING CHANGE: sup config now derives entries from package.json#exports and a server/client glob instead of manual lists; module structure follows flat + barrel convention with .server.js/.client.js runtime suffixes
This commit is contained in:
@@ -1,21 +1,10 @@
|
||||
'use client';
|
||||
|
||||
/**
|
||||
* Widget core — Composant client : nombre d'utilisateurs
|
||||
*
|
||||
* Auto-enregistré via admin/dashboard/widgets/index.client.js.
|
||||
* Pas besoin de modifier features/dashboard.client.js pour ce widget.
|
||||
*
|
||||
* Props du composant :
|
||||
* data — { totalUsers: number, newThisMonth: number } retourné par getUsersDashboardData(), ou null
|
||||
* loading — true tant que les données serveur ne sont pas disponibles
|
||||
*/
|
||||
|
||||
import { registerClientWidget } from '../clientRegistry.js';
|
||||
import { registerWidget } from '../registry.js';
|
||||
import { StatCard } from '@zen/core/shared/components';
|
||||
import { UserMultiple02Icon } from '@zen/core/shared/icons';
|
||||
|
||||
function UsersDashboardWidget({ data, loading }) {
|
||||
function UsersWidget({ data, loading }) {
|
||||
const newThisMonth = data?.newThisMonth ?? 0;
|
||||
return (
|
||||
<StatCard
|
||||
@@ -31,6 +20,4 @@ function UsersDashboardWidget({ data, loading }) {
|
||||
);
|
||||
}
|
||||
|
||||
registerClientWidget('users', UsersDashboardWidget, 10);
|
||||
|
||||
export default UsersDashboardWidget;
|
||||
registerWidget({ id: 'users', Component: UsersWidget, order: 10 });
|
||||
|
||||
Reference in New Issue
Block a user