import React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; import { PieChart } from '@mui/x-charts/PieChart'; import { createTheme, ThemeProvider } from '@mui/material/styles'; const darkTheme = createTheme({ palette: { mode: 'dark', background: { paper: 'transparent' }, }, typography: { fontFamily: '\'Rajdhani\', sans-serif', }, }); const WIN_COLOR = '#5ee89a'; const LOSS_COLOR = '#f67d52'; const DRAW_COLOR = '#95cff5'; const axisStyle = { tickLabelStyle: { fill: 'rgba(255,255,255,0.4)', fontSize: 11, fontFamily: '\'Rajdhani\', sans-serif' }, labelStyle: { fill: 'rgba(255,255,255,0.4)', fontSize: 11, fontFamily: '\'Rajdhani\', sans-serif' }, }; export default function ProfileCharts({ chartData }) { const { months, wins, losses, draws, pieWins, pieLosses, pieDraws } = chartData; const total = pieWins + pieLosses + pieDraws; const hasBars = wins.some(v => 0 < v) || losses.some(v => 0 < v) || draws.some(v => 0 < v); return (
{0 < total && (

Result Breakdown

)} {hasBars && (

Activity (6 months)

)}
); }