<commit_before>{React, ReactBootstrap} = window
{Modal, Button} = ReactBootstrap

ModalArea = React.createClass
  componentDidMount: ->
    window.showModal = @showModal
  componentWillUnmount: ->
    window.showModal = null

  getInitialState: ->
    isShow: false
    title: null
    body: null
    footer: null

  showModal: (options) ->
    return unless options?
    @setState
      isShow: true
      title: options.title
      body: options.body
      footer: options.footer

  close: ->
    @setState
      isShow: false

  render: ->
    <div className="modal-area">
      <Modal autoFocus={true} animation={true} show={@state.isShow} onHide={@close}>
        <Modal.Header>
          <Modal.Title>{@state.title}</Modal.Title>
        </Modal.Header>
        <Modal.Body>
          {@state.body}
        </Modal.Body>
        <Modal.Footer>
          {@state.footer}
          <Button onClick={@close}>{__ "Close"}</Button>
        </Modal.Footer>
      </Modal>
    </div>

module.exports = ModalArea<commit_msg>Update UI: Remove unique warnings of modal-area.<commit_after>{React, ReactBootstrap} = window
{Modal, Button} = ReactBootstrap

ModalArea = React.createClass
  componentDidMount: ->
    window.showModal = @showModal
  componentWillUnmount: ->
    window.showModal = null

  getInitialState: ->
    isShow: false
    title: null
    body: null
    footer: null

  showModal: (options) ->
    return unless options?
    @setState
      isShow: true
      title: options.title
      body: options.body
      footer: options.footer

  close: ->
    @setState
      isShow: false

  render: ->
    <div className="modal-area">
      <Modal autoFocus={true} animation={true} show={@state.isShow} onHide={@close}>
        <Modal.Header>
          <Modal.Title>{@state.title}</Modal.Title>
        </Modal.Header>
        <Modal.Body>
          {
            if @state.body instanceof Array
              for body, i in @state.body
                <div key={i}>{body}</div>
            else
              @state.body
          }
        </Modal.Body>
        <Modal.Footer>
          {@state.footer}
          <Button onClick={@close}>{__ "Close"}</Button>
        </Modal.Footer>
      </Modal>
    </div>

module.exports = ModalArea
{'fraction_non_alphanumeric': 0.1298354824366385, 'fraction_numerical': 0.0, 'mean_word_length': 2.186968838526912, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 45, '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': '5286819', 'n_tokens_mistral': 680, 'n_tokens_neox': 677, 'n_words': 147}