aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/breadcrumbs/breadcrumbs.component.js
blob: 6644836db693c3215e5af4c9708429d475334cad (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
26
27
28
29
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'

export default class Breadcrumbs extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    currentIndex: PropTypes.number,
    total: PropTypes.number,
  }

  render () {
    const { className, currentIndex, total } = this.props

    return (
      <div className={classnames('breadcrumbs', className)}>
        {
          Array(total).fill().map((_, i) => (
            <div
              key={i}
              className="breadcrumb"
              style={{backgroundColor: i === currentIndex ? '#D8D8D8' : '#FFFFFF'}}
            />
          ))
        }
      </div>
    )
  }
}