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
892 B
TypeScript

import type { ReactNode } from 'react';
import { rtlLocales } from '@/lib/i18n';
import { DocsRootProvider } from '@/components/docs-root-provider';
/**
* Shared <html> shell for every root layout (default-locale tree and the
* prefixed [lang] tree). Each route group has its own root layout so that the
* default locale (en) can live at unprefixed URLs while other locales keep a
* /<lang> prefix — this is what makes the static export hydrate cleanly.
*/
export function RootShell({
lang,
children,
}: {
lang: string;
children: ReactNode;
}) {
const dir = rtlLocales.has(lang) ? 'rtl' : 'ltr';
return (
<html lang={lang} dir={dir} suppressHydrationWarning>
<body className="flex flex-col min-h-screen" suppressHydrationWarning>
<DocsRootProvider lang={lang} dir={dir}>
{children}
</DocsRootProvider>
</body>
</html>
);
}