aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/ConnectionContent.js
blob: bd35b5c85052db4b31e334a9b33878d4b7f440cd (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
52
53
54
55
56
57
58
59
import React, {Component} from 'react';
import './ConnectionContent.scss';
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {

} from '@fortawesome/free-solid-svg-icons'
import {useParams} from "react-router-dom";
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;