blob: 36c6ed2f577d54938d252cc84d2c9c701e3bb7f9 (
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
|
import { Component, ReactElement } from 'react';
import { observer } from 'mobx-react';
import withStyles, { WithStylesProps } from 'react-jss';
import { noop } from 'lodash';
import Workspace from '../models/Workspace';
const styles = theme => ({
row: {
height: theme.workspaces.settings.listItems.height,
borderBottom: `1px solid ${theme.workspaces.settings.listItems.borderColor}`,
'&:hover': {
background: theme.workspaces.settings.listItems.hoverBgColor,
},
},
columnName: {},
});
interface IProps extends WithStylesProps<typeof styles> {
workspace: Workspace;
onItemClick: (workspace: Workspace) => void;
}
@observer
class WorkspaceItem extends Component<IProps> {
render(): ReactElement {
const { classes, workspace, onItemClick } = this.props;
return (
<tr className={classes.row}>
<td onClick={() => onItemClick(workspace)} onKeyDown={noop}>
{workspace.name}
</td>
</tr>
);
}
}
export default withStyles(styles, { injectTheme: true })(WorkspaceItem);
|