feat: add version display

This commit is contained in:
hamster1963
2024-12-04 16:04:09 +08:00
parent 1f9b667f0a
commit 97b5ff3a63
4 changed files with 16 additions and 9 deletions
+13 -3
View File
@@ -1,19 +1,29 @@
// src/components/Footer.tsx
import { fetchSetting } from "@/lib/nezha-api";
import { useQuery } from "@tanstack/react-query";
import React from "react";
import { useTranslation } from "react-i18next";
const Footer: React.FC = () => {
const { t } = useTranslation();
const { data: settingData } = useQuery({
queryKey: ["setting"],
queryFn: () => fetchSetting(),
refetchOnMount: true,
refetchOnWindowFocus: true,
});
return (
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
<section className="flex flex-col">
<section className="mt-1 flex items-center justify-between gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
<p>
<div className="flex items-center gap-1">
&copy;2020-{new Date().getFullYear()}{" "}
<a href={"https://github.com/naiba/nezha"} target="_blank">
Nezha
</a>
</p>
<p>{settingData?.data?.version || ""}</p>
</div>
<p>
{t("footer.themeBy")}
<a