aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/TableBox.tsx
blob: 28114036fdc5a72beea2cab3fe7bced4c38a5a35 (plain)
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
import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';

interface TableBoxProps {
    pairs: { x: number; y: number }[];
}

export class TableBox extends React.Component<TableBoxProps> {
    render() {
        return (
            <div className="table-container">
                <table className="table">
                    <thead>
                        <tr className="table-row">
                            <th>x</th>
                            <th>y</th>
                        </tr>
                    </thead>
                    <tbody>
                        {this.props.pairs?.map(p => {
                            return (
                                <tr className="table-row">
                                    <td>{p.x}</td>
                                    <td>{p.y}</td>
                                </tr>
                            );
                        })}
                    </tbody>
                </table>
            </div>
        );
    }
}