Files
ToBePlayed-Frontend/src/components/stats/TrendStats.jsx
T
lobo e054e13a59
Build, Test & Push Frontend / quality-check (push) Successful in 30s
Build, Test & Push Frontend / docker (push) Successful in 22s
feat(stats): add chart form selection and pie, donut, line charts
Tag rows with 0 games are no longer clickable.
2026-10-04 10:43:02 +02:00

21 lines
688 B
React

import {useTranslation} from 'react-i18next';
import {TrendingDown} from 'lucide-react';
import StatsSection from './StatsSection.jsx';
import ChartPicker from './ChartPicker.jsx';
import PileTrend from './PileTrend.jsx';
/**
* @param chart LINE or BARS
* @param onChart `(form)`: shows the picker
*/
export default function TrendStats({trend, chart = 'LINE', onChart}) {
const {t} = useTranslation();
return (
<StatsSection title={t('STATS.TREND.TITLE')} icon={TrendingDown}
action={onChart && <ChartPicker group="TREND" value={chart} onChange={onChart}/>}>
<PileTrend trend={trend} chart={chart}/>
</StatsSection>
);
}