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

import React from 'react'
import classnames from 'classnames'
import defineDebug from 'debug'
import { asPure, asServed, combine } from '../../wrappers'
import Link from './link'

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

/** @lends OtherViewLink */
const OtherViewLink = ({
  srvc,
  className,
  view: viewName,
  target,
  children
}) => {
  const { urlForOtherViewName } = srvc.urlService
  return (
    <Link className={ classnames('other-view-link', className) }
          url={ urlForOtherViewName(viewName) }
          target={ target }
    >
      { children }
    </Link>
  )
}

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