refactory(i18n): Add internationalization support for the service statistics card

This commit is contained in:
YiZixuan
2025-09-08 21:35:48 +08:00
parent b675fddc92
commit f4d47bbd45
6 changed files with 66 additions and 15 deletions
@@ -1,5 +1,6 @@
import React from 'react';
import {useLanguage} from "@/contexts/LanguageContext.tsx";
interface UptimeSummaryProps {
uptime: number;
@@ -7,13 +8,14 @@ interface UptimeSummaryProps {
}
export const UptimeSummary = ({ uptime, interval }: UptimeSummaryProps) => {
const { t } = useLanguage();
return (
<div className="flex items-center justify-between text-xs mt-1">
<span className="text-muted-foreground">
{Math.round(uptime)}% uptime
</span>
<span className="text-xs text-muted-foreground">
Last 20 checks
{t('last20Checks')}
</span>
</div>
);