add translate

This commit is contained in:
smanylov
2025-12-12 11:00:23 +07:00
parent b63828befb
commit b5b66695df
10 changed files with 215 additions and 149 deletions
+5 -3
View File
@@ -1,3 +1,4 @@
import { useTranslations } from 'next-intl';
import { PieChart, Pie, Cell, ResponsiveContainer } from 'recharts';
export const PieChartComponent = ({ data }: {
@@ -7,7 +8,8 @@ export const PieChartComponent = ({ data }: {
color: string
}[]
}) => {
console.log(data)
const t = useTranslations('Global');
return (
<div
className="flex flex-col items-center"
@@ -18,7 +20,7 @@ export const PieChartComponent = ({ data }: {
0
</text>
<text x={100} y={100} className="pie-char-text">
из
{t('out-of')}
</text>
<text x={100} y={120} className="pie-char-text">
0
@@ -42,7 +44,7 @@ export const PieChartComponent = ({ data }: {
{data.map((entry, index) => (
<div key={`cell-${index}`} className="text-white">
<span className="w-2 h-2 rounded-full font-bold inline-block mr-1.5" style={{ backgroundColor: entry.color }}></span>
<span>{entry.name}</span>
<span>{t(entry.name)}</span>
</div>
))}
</div>