aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/ConnectionContent.js
blob: db63cbeab17097473a2c2de0b4673748385068ac (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
41
42
43
44
45
46
47
48
49
50
51
import React, {Component} from 'react';
import './ConnectionContent.scss';
import {Dropdown} from 'react-bootstrap';

class ConnectionContent extends Component {
    render() {
        let content = this.props.connectionPayload;

        if (content === undefined) {
            return <div>nope</div>;
        }

        let payload = content.map(c =>
            <span key={c.id} className={c.from_client ? "from-client" : "from-server"} title="cccccc">
                {c.content}

            </span>
        );

        return (
            <div className="connection-content">
                <div className="connection-content-options">
                    <Dropdown>
                        <Dropdown.Toggle variant="success" id="dropdown-basic">
                            format
                        </Dropdown.Toggle>

                        <Dropdown.Menu>
                            <Dropdown.Item href="#/action-1">plain</Dropdown.Item>
                            <Dropdown.Item href="#/action-2">hex</Dropdown.Item>
                            <Dropdown.Item href="#/action-3">hexdump</Dropdown.Item>
                            <Dropdown.Item href="#/action-3">base32</Dropdown.Item>
                            <Dropdown.Item href="#/action-3">base64</Dropdown.Item>
                            <Dropdown.Item href="#/action-3">ascii</Dropdown.Item>
                        </Dropdown.Menu>
                    </Dropdown>


                </div>

                <pre>{payload}</pre>


            </div>
        );
    }

}


export default ConnectionContent;