import React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; import { LineChart } from '@mui/x-charts/LineChart'; 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 MINES_COLOR = '#f67d52'; const BONUS_COLOR = '#ffd700'; 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, recentGames } = chartData; const total = pieWins + pieLosses + pieDraws; const hasBars = wins.some(v => 0 < v) || losses.some(v => 0 < v) || draws.some(v => 0 < v); const hasRecent = recentGames && (recentGames.mines?.some(v => 0 < v) || recentGames.bonus?.some(v => 0 < v)); return (
{0 < total && (

Result Breakdown

)} {hasBars && (

Activity (6 months)

)} {hasRecent && (

Last {recentGames.labels.length} games — mines & bonus

)}
); }