-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrderList.tsx
43 lines (38 loc) · 880 Bytes
/
OrderList.tsx
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
import React from 'react';
import BootstrapTable from 'react-bootstrap-table-next';
import { Orders, OrderbookItem, OrderType } from 'core/models';
import { orderbookAdapter, formatNumber } from 'core/utils';
const rowClasses = (order: OrderbookItem) => (
order.type === OrderType.Ask ? 'order-ask' : 'order-bid'
);
const columns = [
{
dataField: 'price',
text: 'Price',
formatter: formatNumber,
},
{
dataField: 'size',
text: 'Size',
formatter: formatNumber,
},
{
dataField: 'total',
text: 'Total',
formatter: formatNumber,
}
];
interface IOrderListProps {
data: Orders;
}
const OrderList: React.FC<IOrderListProps> = ({ data }) => (
<BootstrapTable
bootstrap4
keyField="id"
data={orderbookAdapter(data)}
columns={columns}
bordered={false}
rowClasses={rowClasses}
/>
);
export default OrderList;