/**
 * ThreadLink component
 *
 * Generated by coz on 2016-12-29,
 * from a template provided by apeman-asset-templates.
 *
 * @function ThreadLink
 */
'use strict'

import React from 'react'
import classnames from 'classnames'
import defineDebug from 'debug'

import { IconClasses } from 'ore-fol-enums'
import { asPure, asServed, combine } from '../../wrappers'
import Link from './link'
const { THREAD_ICON } = IconClasses

const debug = defineDebug('project:fragment:thread-link')

/** @lends ThreadLink */
const ThreadLink = ({
  srvc,
  thread,
  className
}) => {
  const { urlForThread } = srvc.urlService
  return (
    <Link className={ classnames('thread-link', className) }
          url={ urlForThread(thread) }
          icon={ THREAD_ICON }
    > {thread.name} </Link>
  )
}

export default combine(
  asPure(),
  asServed.proxy()
)(ThreadLink)
