const NODE_ICONS = {
  foreign_buy:  { icon: '👤', label: '외국인' },
  volume_surge: { icon: '⚡', label: '거래량' },
  momentum:     { icon: '🚀', label: '모멘텀' },
  high52w:      { icon: '🆙', label: '52w고' },
  rs_rating:    { icon: '💪', label: 'RS' },
  ma_alignment: { icon: '📈', label: '정배열' },
  vcp_lite:     { icon: '🌀', label: 'VCP' },
};

export default function ScoreChips({ scores }) {
  return (
    <div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
      {Object.entries(scores || {}).map(([name, s]) => {
        const meta = NODE_ICONS[name];
        if (!meta) return null;
        const active = s >= 70;
        return (
          <span key={name}
                title={`${meta.label}: ${s.toFixed?.(0) ?? s}`}
                style={{
                  padding: '2px 6px', borderRadius: 4, fontSize: 11,
                  background: active ? '#fbbf24' : '#1f2937',
                  color: active ? '#0b0f17' : '#9ca3af',
                }}>
            {meta.icon}{Math.round(s)}
          </span>
        );
      })}
    </div>
  );
}
