aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/presentational/WeekDisplay.js
blob: 38125b253ff4ca558a0f30f5eba674603e12dec0 (plain)
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
import React from 'react';
import PropTypes from 'prop-types';

class WeekDisplay extends React.Component {
  static propTypes = {
    selectedWeek: PropTypes.number.isRequired,
    currentWeek: PropTypes.number.isRequired,
  }

  render() {
    const { selectedWeek, currentWeek } = this.props;

    switch (selectedWeek) {
      case currentWeek:
        return `Huidige week • ${selectedWeek}`;
      case currentWeek + 1:
        return `Volgende week • ${selectedWeek}`;
      case currentWeek - 1:
        return `Vorige week • ${selectedWeek}`;
      default:
        return `Week ${selectedWeek}`;
    }
  }
}

export default WeekDisplay;