/
Pilots.jsx
55 lines (46 loc) · 1.29 KB
/
Pilots.jsx
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
43
44
45
46
47
48
49
50
51
52
53
54
55
import React, {Component} from "react";
import {connect} from "react-redux";
import {
Grid,
Segment,
Header,
} from "semantic-ui-react";
import PilotsList from "../PilotsList";
import PilotDetails from "../PilotDetails";
const pilots = [
{
name : "Natasha Kerensky",
rank : "Captain",
age : 52,
gunnery : 2,
piloting : 3,
mechType : "WHM-6R",
}
];
export class Pilots extends Component {
state = {
pilots : pilots,
}
render() {
const {pilots} = this.state;
// Use the first pilot as the "current" one for display, if available.
const currentPilot = pilots[0] || {};
return (
<Segment>
<Grid>
<Grid.Column width={10}>
<Header as="h3">Pilot List</Header>
<PilotsList pilots={pilots} />
</Grid.Column>
<Grid.Column width={6}>
<Header as="h3">Pilot Details</Header>
<Segment >
<PilotDetails pilot={currentPilot} />
</Segment>
</Grid.Column>
</Grid>
</Segment>
);
}
}
export default connect()(Pilots);