import React from 'react'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, } from 'recharts'; const METRIC_NAMES = ['freq', 'finger', 'gap', 'cooccur', 'divers']; const COLORS = ['#34d399', '#60a5fa', '#fbbf24', '#f43f5e', '#c084fc']; export default function BaseHistory({ history }) { if (!history || history.length === 0) { return (

12주 Base 변화

학습 이력이 부족합니다.

); } const data = history .slice() .reverse() .map(h => { const w = h.weight || [0, 0, 0, 0, 0]; return { date: (h.effective_from || '').slice(5), freq: w[0], finger: w[1], gap: w[2], cooccur: w[3], divers: w[4], reason: h.update_reason, }; }); return (

Base 변화 (최근 {history.length}주)

{METRIC_NAMES.map((name, i) => ( ))}
); }