language bug fixing2
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// app/[lang]/layout.tsx
|
||||
import { dir } from "i18next";
|
||||
import Header from "@/components/nav_foot/header";
|
||||
import Navbar from "@/components/nav_foot/navbar";
|
||||
@@ -6,15 +5,18 @@ import Footer from "@/components/nav_foot/footer";
|
||||
import Contact from "@/components/pageParts/contact";
|
||||
import UpScrollIcon from "@/components/upScroll";
|
||||
|
||||
export default function LangLayout({
|
||||
export default async function LangLayout({
|
||||
children,
|
||||
params,
|
||||
}: Readonly<{
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: { lang: "uz" | "ru" };
|
||||
}>) {
|
||||
params: Promise<{ lang: "uz" | "ru" }>; // ✅ Promise shaklda
|
||||
}) {
|
||||
const { lang } = await params; // ✅ await bilan destructuring
|
||||
const direction = dir(lang) || "ltr";
|
||||
|
||||
return (
|
||||
<html lang={params.lang} dir={dir(params.lang)}>
|
||||
<html lang={lang} dir={direction}>
|
||||
<body>
|
||||
<Header />
|
||||
<Navbar />
|
||||
|
||||
Reference in New Issue
Block a user