Newer
Older
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
import { useAppSelector } from '@hooks';
import { Col, Container, Row, Table } from 'react-bootstrap';
import './device.scss';
import { useDeviceViewModel } from '@viewmodel/device.viewmodel';
function DeviceView() {
const { devices } = useAppSelector(state => state.device);
useDeviceViewModel();
const getDeviceTable = () => {
return devices.map((device, index) => (
<tr key={index}>
<td>{device.name}</td>
<td>{device.id}</td>
<td>{device.pid}</td>
</tr>
))
}
return (
<div className='m-4 pt-4'>
<Container className="bg-white rounded c-box">
<Row >
<Col><h3>Device list</h3></Col>
</Row>
<Row className='mt-2'>
<Col>
<Table striped bordered hover className='table-primary'>
<thead>
<tr>
<th>Name</th>
<th>UUID</th>
<th>User</th>
<th>Last updated</th>
</tr>
</thead>
<tbody>
{getDeviceTable()}
</tbody>
</Table>
</Col>
</Row>
</Container>
</div>
)
}
export default DeviceView