feat: detail overview i18n

This commit is contained in:
hamster1963
2024-11-24 21:44:12 +08:00
parent 8812cd1d3f
commit ee03928a56
9 changed files with 157 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
import { Card, CardContent } from "@/components/ui/card";
import { cn, formatBytes } from "@/lib/utils";
import { useTranslation } from "react-i18next";
type ServerOverviewProps = {
online: number;
@@ -16,6 +17,8 @@ export default function ServerOverview({
up,
down,
}: ServerOverviewProps) {
const { t } = useTranslation();
return (
<>
<section className="grid grid-cols-2 gap-4 lg:grid-cols-4">
@@ -23,7 +26,7 @@ export default function ServerOverview({
<CardContent className="px-6 py-3">
<section className="flex flex-col gap-1">
<p className="text-sm font-medium md:text-base">
{"Total servers"}
{t("serverOverview.totalServers")}
</p>
<div className="flex items-center gap-2">
<span className="relative flex h-2 w-2">
@@ -42,7 +45,7 @@ export default function ServerOverview({
<CardContent className="px-6 py-3">
<section className="flex flex-col gap-1">
<p className="text-sm font-medium md:text-base">
{"Online servers"}
{t("serverOverview.onlineServers")}
</p>
<div className="flex items-center gap-2">
<span className="relative flex h-2 w-2">
@@ -63,7 +66,7 @@ export default function ServerOverview({
<CardContent className="px-6 py-3">
<section className="flex flex-col gap-1">
<p className="text-sm font-medium md:text-base">
{"Offline servers"}
{t("serverOverview.offlineServers")}
</p>
<div className="flex items-center gap-2">
<span className="relative flex h-2 w-2">
@@ -83,7 +86,7 @@ export default function ServerOverview({
<CardContent className="relative px-6 py-3">
<section className="flex flex-col gap-1">
<p className="text-sm font-medium md:text-base">
{"Total bandwidth"}
{t("serverOverview.totalBandwidth")}
</p>
<section className="flex flex-col sm:flex-row pt-[8px] sm:items-center items-start gap-1">