<commit_before>import React, { PropTypes, Component } from 'react'
import { Group } from 'react-art'
import Rectangle from 'react-art/lib/Rectangle.art'

import composeBrick from './composeBrick'
import Constants from './constants'
import { getComponent } from '../utils/ComponentFactory'
import { PositionPropTypes, SizePropTypes } from '../propTypes'
import TestInput from './TestInput'

class MainBrick extends Component {
  render() {
    const { inner, size, unitTest } = this.props
    const { Brick, Slot } = MainBrick._constants

    return (
      <Group y={ Slot.height } >
        { unitTest.map((element) => {
            return (
              <TestInput
                key={ element.id }
                { ...element }
              />
            )
          })
        }
        <Rectangle
          height={ size.height }
          width={ size.width }
          stroke={ Brick.strokeColor }
          fill={ Brick.fillColor }
        />
        { inner.map((element) => {
            const ReactComponent = getComponent(element.componentName)

            return (
              <ReactComponent
                key={ element.id }
                { ...element }
              />
            )
          })
        }
      </Group>
    )
  }
}

MainBrick.propTypes = {
  id: PropTypes.number.isRequired,
  inner: PropTypes.arrayOf(
    PropTypes.shape({
      componentName: PropTypes.string.isRequired,
      id: PropTypes.number.isRequired,
      name: PropTypes.string,
      position: PositionPropTypes,
      value: PropTypes.any
    })
  ).isRequired,
  size: SizePropTypes.isRequired,
  unitTest: PropTypes.array.isRequired
}

MainBrick._constants = {
  Slot: Constants.Slot,
  Brick: Constants.MainBrick
}

export default composeBrick(MainBrick)<commit_msg>Temporary fix to inner elements of MainBrick being 'undefined' after deleting element<commit_after>import React, { PropTypes, Component } from 'react'
import { Group } from 'react-art'
import Rectangle from 'react-art/lib/Rectangle.art'

import composeBrick from './composeBrick'
import Constants from './constants'
import { getComponent } from '../utils/ComponentFactory'
import { PositionPropTypes, SizePropTypes } from '../propTypes'
import TestInput from './TestInput'

class MainBrick extends Component {
  render() {
    const { inner, size, unitTest } = this.props
    const { Brick, Slot } = MainBrick._constants

    return (
      <Group y={ Slot.height } >
        { unitTest.map((element) => {
            return (
              <TestInput
                key={ element.id }
                { ...element }
              />
            )
          })
        }
        <Rectangle
          height={ size.height }
          width={ size.width }
          stroke={ Brick.strokeColor }
          fill={ Brick.fillColor }
        />
        { inner.map((element) => {
            if(element) {
              const ReactComponent = getComponent(element.componentName)

              return (
                <ReactComponent
                  key={ element.id }
                  { ...element }
                />
              )
            }
          })
        }
      </Group>
    )
  }
}

MainBrick.propTypes = {
  id: PropTypes.number.isRequired,
  inner: PropTypes.arrayOf(
    PropTypes.shape({
      componentName: PropTypes.string.isRequired,
      id: PropTypes.number.isRequired,
      name: PropTypes.string,
      position: PositionPropTypes,
      value: PropTypes.any
    })
  ).isRequired,
  size: SizePropTypes.isRequired,
  unitTest: PropTypes.array.isRequired
}

MainBrick._constants = {
  Slot: Constants.Slot,
  Brick: Constants.MainBrick
}

export default composeBrick(MainBrick)
{'fraction_non_alphanumeric': 0.11002710027100271, 'fraction_numerical': 0.0, 'mean_word_length': 1.945730247406225, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '636500', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1031, 'n_words': 225}