import type { ReactNode } from 'react';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/app/layout.config';

export default async function Layout({
  params,
  children,
}: {
  params: Promise<{ lang: string }>;
  children: ReactNode;
}) {
  return (
    <DocsLayout {...baseOptions} tree={source.pageTree[(await params).lang]}>
      {children}
    </DocsLayout>
  );
}
