You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
volume24h/app/[locale]/layout.tsx

49 lines
1.3 KiB

"use client";
import { useLocale } from "next-intl";
import { notFound } from "next/navigation";
import "../globals.css";
import type { Metadata } from "next";
import { Inika } from "next/font/google";
import { ReactNode } from "react";
import { NextIntlClientProvider } from "next-intl";
import Header from "./components/layout/Header";
import Bottom from "./components/layout/Bottom";
const inika = Inika({ weight: "400", subsets: ["latin"] });
export const metadata: Metadata = {
title: "Volume24h",
description: "Volume24h",
};
interface RootLayoutProps {
children: ReactNode;
params: any; // You can specify the type of 'params' as per your requirements
}
export default async function RootLayout({
children,
params,
}: RootLayoutProps) {
const locale = useLocale();
let messages;
try {
messages = (await import(`../../messages/${locale}.json`)).default;
} catch (error) {
notFound();
}
return (
<html lang={locale}>
<body className={inika.className}>
<NextIntlClientProvider locale={locale} messages={messages}>
<Header></Header>
<div className="flex min-h-screen flex-col items-center justify-between p-24">
{children}
</div>
<Bottom></Bottom>
</NextIntlClientProvider>
</body>
</html>
);
}