# All files / src/components/ssh-tunnel-status ssh-tunnel-status.jsx

88.33% Statements 53/60
58.97% Branches 23/39
100% Functions 12/12
92.5% Lines 37/40

    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

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    4x

    7x

    7x

    1x

    1x
    1x

    7x

    7x

    1x

     import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import classnames from 'classnames';

    import styles from './ssh-tunnel-status.less';

    class SshTunnelStatus extends Component {
      static displayName = 'SshTunnelStatusComponent';IEE

      static propTypes = {
        sshTunnel: PropTypes.bool,
        sshTunnelHostPortString: PropTypes.string
      };

      static defaultProps = {
        sshTunnel: false,
        sshTunnelHostPortString: ''
      };

      /**
       * Render SshTunnelStatus component.
       *
       * @returns {React.Component} The rendered component.
       */
      render() {
        if (!this.props.sshTunnel) {
          return null;
        }I

        return (I
          <div
            data-test-id="ssh-tunnel-status"EI
            className={classnames(styles['ssh-tunnel-status'])}>
            <i className="fa fa-lock" aria-hidden />
            <div className={classnames(styles['ssh-tunnel-status-label'])}>
              <div className={classnames(styles['ssh-tunnel-status-label-is-static'])}>
                SSH connection via:
              </div>
              <div className={classnames(styles['ssh-tunnel-status-string'])}>
                {this.props.sshTunnelHostPortString}
              </div>
            </div>
          </div>
        );
      }
    }

    export default SshTunnelStatus;
    export { SshTunnelStatus };