aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/components/WorkspaceItem.js
blob: b2c2a4830408a8f7402c6ec1ead2c971d05b8495 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { intlShape } from 'react-intl';
import { observer } from 'mobx-react';
import classnames from 'classnames';
import Workspace from '../models/Workspace';

// const messages = defineMessages({});

@observer
class WorkspaceItem extends Component {
  static propTypes = {
    workspace: PropTypes.instanceOf(Workspace).isRequired,
    onItemClick: PropTypes.func.isRequired,
  };

  static contextTypes = {
    intl: intlShape,
  };

  render() {
    const { workspace, onItemClick } = this.props;
    // const { intl } = this.context;

    return (
      <tr
        className={classnames({
          'workspace-table__row': true,
        })}
      >
        <td
          className="workspace-table__column-name"
          onClick={() => onItemClick(workspace)}
        >
          {workspace.name}
        </td>
      </tr>
    );
  }
}

export default WorkspaceItem;