import React, { PropTypes } from 'react'
import styles from './index.css'

const propTypes = {
  className: PropTypes.string,
  image: PropTypes.string,
  width: PropTypes.string,
  height: PropTypes.string,
}

const defaultProps = {
  className: '',
}

const HeadPortrait = ({ className, image, width, height, ...other }) => {
  const style = {
    width,
    height,
    backgroundImage: `url(${image})`,
    backgroundSize: `${width} ${height}`,
  }

  return (
    <div {...other} style={style} className={`${styles.headPortrait} ${className}`}></div>
  )
}

HeadPortrait.propTypes = propTypes
HeadPortrait.defaultProps = defaultProps

export default HeadPortrait
