aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/card/card.component.js
blob: bb7241da12d88e7f21dce110815421a4d25cb170 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'

export default class Card extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    overrideClassName: PropTypes.bool,
    title: PropTypes.string,
    children: PropTypes.node,
  }

  render () {
    const { className, overrideClassName, title } = this.props

    return (
      <div className={classnames({ 'card': !overrideClassName }, className)}>
        <div className="card__title">
          { title }
        </div>
        { this.props.children }
      </div>
    )
  }
}