|
@@ -1,22 +1,20 @@
|
|
|
-"use client";
|
|
|
import Footer from "@/components/Footer";
|
|
|
-import { usePathname } from "@/i18n";
|
|
|
-import { FC, PropsWithChildren, useEffect } from "react";
|
|
|
+import { getTranslations } from "next-intl/server";
|
|
|
+import { FC, PropsWithChildren } from "react";
|
|
|
type Props = {};
|
|
|
+
|
|
|
+export const generateMetadata = async () => {
|
|
|
+ const t = await getTranslations("titles");
|
|
|
+ return {
|
|
|
+ title: t("home"),
|
|
|
+ };
|
|
|
+};
|
|
|
const Layout: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
const { children } = props;
|
|
|
-
|
|
|
- // 获取分享id
|
|
|
- const pathname = usePathname();
|
|
|
- useEffect(() => {
|
|
|
- const [, shareId] = pathname.split("/");
|
|
|
- if (!shareId || shareId === "xxxxxx") return;
|
|
|
- sessionStorage.setItem("shareId", shareId);
|
|
|
- }, []);
|
|
|
return (
|
|
|
<>
|
|
|
<main className={"main-footer"}>{children}</main>
|
|
|
- <Footer></Footer>
|
|
|
+ <Footer />
|
|
|
</>
|
|
|
);
|
|
|
};
|