add translate
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user