 
 React = require 'react'
 usersStore = require '../data/users'
-{dispatch} = require '../lib/dispatcher'
 ChildRouter = require 'react-child-router'
 {Link} = ChildRouter
 Markdown = require '../components/markdown'

  ]

  render: ->
    <div className="user-details">
      <div className="tabbed-content" data-side="top">
        <div className="tabbed-content-tabs">
          <Link href="#/users/#{@props.login}" className="tabbed-content-tab">Bio</Link>
          <Link href="#/users/#{@props.login}/activity" className="tabbed-content-tab">Activity</Link>
          <Link href="#/users/#{@props.login}/collections" className="tabbed-content-tab">Collections</Link>
          <Link href="#/users/#{@props.login}/projects" className="tabbed-content-tab">Projects</Link>
          <Link href="#/users/#{@props.login}/talk" className="tabbed-content-tab"><i className="fa fa-comments"></i></Link>
        </div>

        <ChildRouter className="content-container">
          <div hash="#/users/#{@props.login}">
            {if @state.user?
              <Markdown>{@state.user.bio}</Markdown>
            else
              <LoadingIndicator />}
          </div>

          <div hash="#/users/#{@props.login}/activity">
            <p>Timeline of this user’s recent activity</p>
          </div>

          <div hash="#/users/#{@props.login}/collections">
            <p>Collections this user has created</p>
          </div>

          <div hash="#/users/#{@props.login}/projects">
            <p>Projects this user has created or has a special role in</p>
          </div>

          <div hash="#/users/#{@props.login}/talk">
            <p>Your private messages with this user</p>
          </div>
        </ChildRouter>
      </div>
    </div>

module.exports = React.createClass
  displayName: 'UserProfilePage'

  render: ->
    <div className="user-profile-page">
      <UserHeader login={@props.params.login} />
      <UserDetails login={@props.params.login} />
    </div>

UserHeader = React.createClass
  displayName: 'UserHeader'

  render: ->
    if @props.user?
      <div>User OK</div>
    else
      <div>User not found</div>

  OLD_RENDER: ->

UserDetails = React.createClass
  displayName: 'UserDetails'
