import React , { useState , useEffect } from "react";
import { Link } from 'react-router-dom';

export default ({user}) => {
  
  return (
    <ul className="urllist">
      {
        user && user.login ? 
        <React.Fragment>
          <Link to={`/accounts/${user.login}/memos`}>
            <span>我的帖子</span>
            <i className="iconfont icon-youjiantou"></i>
          </Link>
          <Link to={`/accounts/${user && user.login}/stars`}>
            <span>我的收藏</span>
            <i className="iconfont icon-youjiantou"></i>
          </Link>
          <Link to={`/accounts/${user && user.login}/interesting`}>
            <span>我感兴趣的论坛</span>
            <i className="iconfont icon-youjiantou"></i>
          </Link>
        </React.Fragment>
        :
        <React.Fragment>
          <a href={"/login"}>
            <span>我的帖子</span>
            <i className="iconfont icon-youjiantou"></i>
          </a>
          <a href={`/login`}>
            <span>我的收藏</span>
            <i className="iconfont icon-youjiantou"></i>
          </a>
          <a href={`/login`}>
            <span>我感兴趣的论坛</span>
            <i className="iconfont icon-youjiantou"></i>
          </a>
        </React.Fragment>
      }
    </ul>
  );
};
