diff --git a/app/(main)/[id]/page.tsx b/app/(main)/[id]/page.tsx index ff37d98..f7c2264 100644 --- a/app/(main)/[id]/page.tsx +++ b/app/(main)/[id]/page.tsx @@ -5,15 +5,13 @@ import ServerDetailChartClient from "@/app/(main)/ClientComponents/ServerDetailC import ServerDetailClient from "@/app/(main)/ClientComponents/ServerDetailClient"; import TabSwitch from "@/components/TabSwitch"; import { Separator } from "@/components/ui/separator"; -import { useTranslations } from "next-intl"; import { useState } from "react"; export const runtime = 'edge'; export default function Page({ params }: { params: { id: string } }) { - const t = useTranslations("TabSwitch"); - const tabs = [t("Detail"), t("Network")]; + const tabs = ["Detail", "Network"]; const [currentTab, setCurrentTab] = useState(tabs[0]); return (
diff --git a/app/(main)/header.tsx b/app/(main)/header.tsx index 2a1c1a7..015a4dc 100644 --- a/app/(main)/header.tsx +++ b/app/(main)/header.tsx @@ -7,7 +7,6 @@ import { Skeleton } from "@/components/ui/skeleton"; import getEnv from "@/lib/env-entry"; import { DateTime } from "luxon"; import { useTranslations } from "next-intl"; -import { useLocale } from "next-intl"; import Image from "next/image"; import { useRouter } from "next/navigation"; import React, { useEffect, useRef, useState } from "react"; @@ -63,7 +62,7 @@ function Header() { // https://github.com/streamich/react-use/blob/master/src/useInterval.ts const useInterval = (callback: Function, delay?: number | null) => { - const savedCallback = useRef(() => {}); + const savedCallback = useRef(() => { }); useEffect(() => { savedCallback.current = callback; }); diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx index 988a736..9fbed8b 100644 --- a/app/(main)/page.tsx +++ b/app/(main)/page.tsx @@ -1,16 +1,9 @@ import ServerList from "@/components/ServerList"; import ServerOverview from "@/components/ServerOverview"; -import { unstable_setRequestLocale } from "next-intl/server"; export const runtime = 'edge'; -export default function Home({ - params: { locale }, -}: { - params: { locale: string }; -}) { - unstable_setRequestLocale(locale); - +export default function Home() { return (
diff --git a/components/TabSwitch.tsx b/components/TabSwitch.tsx index 7701815..7bae3e0 100644 --- a/components/TabSwitch.tsx +++ b/components/TabSwitch.tsx @@ -2,7 +2,8 @@ import { cn } from "@/lib/utils"; import { motion } from "framer-motion"; -import React, { useState } from "react"; +import { useTranslations } from "next-intl"; +import React from "react"; export default function TabSwitch({ tabs, @@ -13,6 +14,7 @@ export default function TabSwitch({ currentTab: string; setCurrentTab: (tab: string) => void; }) { + const t = useTranslations("TabSwitch"); return (
@@ -38,7 +40,7 @@ export default function TabSwitch({ /> )}
-

{tab}

+

{t(tab)}

))} diff --git a/components/sign-in.tsx b/components/sign-in.tsx deleted file mode 100644 index 051637b..0000000 --- a/components/sign-in.tsx +++ /dev/null @@ -1,49 +0,0 @@ -"use client" - -import Footer from "@/app/[locale]/(main)/footer"; -import Header from "@/app/[locale]/(main)/header"; - -import { getCsrfToken } from "next-auth/react" -import { useEffect, useState } from "react"; - -export function SignIn() { - const [csrfToken, setCsrfToken] = useState("") - - useEffect(() => { - async function loadProviders() { - const csrf = await getCsrfToken() - setCsrfToken(csrf) - } - loadProviders() - }, []) - - - return ( -
-
-
-
- -
- - -
-
-
-
- ); -} diff --git a/package.json b/package.json index dfda07a..b1d8f9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nezha-dash", - "version": "0.8.0", + "version": "1.0.0", "private": true, "scripts": { "dev": "next dev -p 3020",