import React from 'react';
import { Input } from 'antd';
import { Link } from 'react-router-dom';

const Search = Input.Search;
export default (({ onSearch , current_user , showLoginDialog })=>{
  return(
    <React.Fragment>
      <Search onSearch={onSearch} placeholder="搜索" allowClear/>
      {
        current_user && current_user.login ?
        <Link className="greenbtn" to={`/forums/new`} style={{width:"100%",marginTop:"20px"}}>
          <i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么
        </Link>
        :
        <a className="greenbtn" onClick={showLoginDialog} style={{width:"100%",marginTop:"20px"}}>
          <i className="iconfont icon-bianjishijuan3x" style={{marginRight:"5px"}}></i>写点什么
        </a>
      }
    </React.Fragment>
  )
})