<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';

import { outlineBorder } from 'react/styles/mixins';

import Box from 'react/components/UI/Box';
import { DividerButton } from 'react/components/UI/Buttons';
import ConnectionSelection from 'react/components/ConnectionSelection';

const Container = styled(Box).attrs({
  pt: 4,
  px: 4,
  pb: 0,
  border: '1px solid',
  borderColor: 'gray.regular',
})`
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: white;

  &:after {
    margin: -1px;
    ${outlineBorder()}
  }
`;

export default class OverlayConnect extends Component {
  static propTypes = {
    id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
    type: PropTypes.oneOf(['CHANNEL', 'BLOCK']).isRequired,
    onClose: PropTypes.func.isRequired,
  }

  stopPropagation = e =>
    e.stopPropagation();

  render() {
    const { id, type, onClose } = this.props;

    return (
      <Container onClick={this.stopPropagation}>
        <Box flex="1">
          <ConnectionSelection id={id} type={type} isOutlined={false} />
        </Box>

        <DividerButton f={4} mb="-1px" onClick={onClose}>
          Close
        </DividerButton>
      </Container>
    );
  }
}
<commit_msg>Wrap in ErrorBoundary<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';

import { outlineBorder } from 'react/styles/mixins';

import Box from 'react/components/UI/Box';
import { DividerButton } from 'react/components/UI/Buttons';
import ErrorBoundary from 'react/components/UI/ErrorBoundary';
import ConnectionSelection from 'react/components/ConnectionSelection';

const Container = styled(Box).attrs({
  pt: 4,
  px: 4,
  pb: 0,
  border: '1px solid',
  borderColor: 'gray.regular',
})`
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: white;

  &:after {
    margin: -1px;
    ${outlineBorder()}
  }
`;

export default class OverlayConnect extends Component {
  static propTypes = {
    id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
    type: PropTypes.oneOf(['CHANNEL', 'BLOCK']).isRequired,
    onClose: PropTypes.func.isRequired,
  }

  stopPropagation = e =>
    e.stopPropagation();

  render() {
    const { id, type, onClose } = this.props;

    return (
      <Container onClick={this.stopPropagation}>
        <Box flex="1">
          <ErrorBoundary isReloadable={false}>
            <ConnectionSelection id={id} type={type} isOutlined={false} />
          </ErrorBoundary>
        </Box>

        <DividerButton f={4} mb="-1px" onClick={onClose}>
          Close
        </DividerButton>
      </Container>
    );
  }
}

{'fraction_non_alphanumeric': 0.14111440817672272, 'fraction_numerical': 0.011869436201780416, 'mean_word_length': 3.3971014492753624, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5566441', 'n_tokens_mistral': 982, 'n_tokens_neox': 967, 'n_words': 231}