import React, { useState } from "react";
import { WhiteBack } from "../css/layout";
import Title from './Title';
import UserInfo from "./UserInfo";
import { getImageUrl } from 'educoder';
export default (({ author }) => {
  return (
    <WhiteBack>
      <Title>版块活跃作者</Title>
      <ul className="authorUl">
        {
          author && author.length > 0 ?
          author.map((item,key)=>{
            return(
              <UserInfo login={item.login} url={getImageUrl(`${item.image_url}`)} name={item.username} column/>
            )
          })
          :""
        }
      </ul>
    </WhiteBack>
  );
});
