'use client';

import { usePathname } from 'next/navigation';
import { ApiKeyWidget } from '@/components/shared/ApiKeyWidget/apikey-widget';
import { ApiKeyProvider } from '@/components/shared/ApiKeyWidget/apikey-context';
import { PageProvider } from '@/contexts/page-context';

const navItems = [
  { label: 'API', href: '/docs/' },
  { label: 'SDK', href: '#', disabled: true },
  { label: 'MCP', href: '#', disabled: true },
  { label: 'CLI', href: '#', disabled: true },
  { label: 'Lab', href: '/demo/tti/' },
];

export default function DemoLayout({ children }: { children: React.ReactNode }) {
  const pathname = usePathname();

  return (
    <ApiKeyProvider>
      <PageProvider
        navItems={navItems}
        currentPath={pathname}
        rightSlot={<ApiKeyWidget />}
      >
        {children}
      </PageProvider>
    </ApiKeyProvider>
  );
}
