export function RankList({ items, title, valueFormatter }) {
  return (
    <div className="rank-list">
      <div className="rank-title">{title}</div>
      {!items.length ? <div className="rank-empty">暂无数据</div> : null}
      {items.map((item, index) => (
        <div className="rank-row" key={item.country}>
          <span>{index + 1}</span>
          {item.flag ? <i className="rank-flag">{item.flag}</i> : null}
          <strong>{item.country}</strong>
          <b>{valueFormatter(item.recharge_usd_minor)}</b>
        </div>
      ))}
    </div>
  );
}
