blob: 92565b45c7b2d2dd0b3d6938998a5e74c21821ce (
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
|
import { inject, observer } from 'mobx-react';
import { Component } from 'react';
import type { StoresProps } from '../../../@types/ferdium-components.types';
import ErrorBoundary from '../../../components/util/ErrorBoundary';
import {
createWorkspaceRequest,
deleteWorkspaceRequest,
getUserWorkspacesRequest,
updateWorkspaceRequest,
} from '../api';
import WorkspacesDashboard from '../components/WorkspacesDashboard';
import { workspaceStore } from '../index';
import type Workspace from '../models/Workspace';
interface IProps extends StoresProps {}
@inject('stores', 'actions')
@observer
class WorkspacesScreen extends Component<IProps> {
render() {
const { actions } = this.props;
return (
<ErrorBoundary>
<WorkspacesDashboard
workspaces={workspaceStore.workspaces}
getUserWorkspacesRequest={getUserWorkspacesRequest}
createWorkspaceRequest={createWorkspaceRequest}
deleteWorkspaceRequest={deleteWorkspaceRequest}
updateWorkspaceRequest={updateWorkspaceRequest}
onCreateWorkspaceSubmit={data => actions.workspaces.create(data)}
onWorkspaceClick={(workspace: Workspace) =>
actions.workspaces.edit({ workspace })
}
/>
</ErrorBoundary>
);
}
}
export default WorkspacesScreen;
|