'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 });
