Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

30 lines
810 B
TypeScript

'use client';
import { RootProvider } from 'fumadocs-ui/provider/next';
import { i18nProvider } from 'fumadocs-ui/i18n';
import type { ReactNode } from 'react';
import { translations } from '@/lib/i18n';
import StaticSearchDialog from '@/components/search-dialog';
// Client-side provider wrapper. The custom static SearchDialog must be wired in
// from a client component — a component function cannot be passed from a server
// component across the RootProvider client boundary.
export function DocsRootProvider({
lang,
dir,
children,
}: {
lang: string;
dir: 'ltr' | 'rtl';
children: ReactNode;
}) {
return (
<RootProvider
dir={dir}
i18n={i18nProvider(translations, lang)}
search={{ SearchDialog: StaticSearchDialog }}
>
{children}
</RootProvider>
);
}