970092fccb
- add `ZEN_DEVKIT` env variable to enable/disable devkit - add `isDevkitEnabled()` utility and export it from public api - register devkit nav section and items conditionally when devkit is enabled - add devkit route handling in admin page client and server - add DevkitPage, ComponentsPage, and IconsPage client components
24 lines
773 B
JavaScript
24 lines
773 B
JavaScript
'use client';
|
|
|
|
import { registerPage } from '../registry.js';
|
|
import ComponentsPage from './ComponentsPage.client.js';
|
|
import IconsPage from './IconsPage.client.js';
|
|
|
|
function DevkitPage({ params, devkitEnabled }) {
|
|
if (!devkitEnabled) {
|
|
return (
|
|
<div className="flex items-center justify-center py-24 text-neutral-400 dark:text-neutral-600 text-sm">
|
|
DevKit désactivé. Définir <code className="mx-1 font-mono bg-neutral-100 dark:bg-neutral-800 px-1 rounded">ZEN_DEVKIT=true</code> pour activer.
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const subPage = params?.[1] || 'components';
|
|
|
|
if (subPage === 'icons') return <IconsPage />;
|
|
return <ComponentsPage />;
|
|
}
|
|
|
|
export default DevkitPage;
|
|
registerPage({ slug: 'devkit', title: 'DevKit', Component: DevkitPage });
|