| 1 | import Link from "next/link"; |
| 2 | import { DocsPreviewSearch } from "@/components/docs-preview/search-palette"; |
| 3 | import { DocsPreviewSidebar } from "@/components/docs-preview/sidebar"; |
| 4 | import { DOCS_PREVIEW_COPY as COPY } from "@/lib/content/docs-preview"; |
| 5 | import { getDocsShell, pickText, pickTextLocale } from "@/lib/i18n/dictionaries"; |
| 6 | |
| 7 | export default async function DocsPreviewLayout({ children, params }: { children: React.ReactNode; params: Promise<{ locale: string }> }) { |
| 8 | const { locale } = await params; |
| 9 | const shell = getDocsShell(locale); |
| 10 | const t = (key: keyof typeof COPY) => pickText(COPY[key], locale); |
| 11 | return ( |
| 12 | <div className="dp portal-container"> |
| 13 | <aside className="dp-side"> |
| 14 | <Link href={`/${locale}/docs-preview`} className="dp-side-title">{t("title")}</Link> |
| 15 | <DocsPreviewSearch |
| 16 | locale={locale} |
| 17 | indexHref={`/docs-preview/search.${pickTextLocale(locale)}.json`} |
| 18 | labels={{ search: t("search"), placeholder: shell.searchPlaceholder, empty: t("searchEmpty"), none: t("searchNone"), failed: t("searchFailed"), close: t("close") }} |
| 19 | /> |
| 20 | <DocsPreviewSidebar locale={locale} label={shell.sidebarAria} /> |
| 21 | </aside> |
| 22 | {children} |
| 23 | </div> |
| 24 | ); |
| 25 | } |
| 26 |