<commit_before>import Portal from 'widget/portal'
import PropTypes from 'prop-types'
import React from 'react'
import styles from './modal.module.css'

export const Modal = ({children}) =>
    <Portal>
        <div className={styles.modal}>
            {children}
        </div>
    </Portal>

Modal.propTypes = {
    children: PropTypes.any.isRequired
}<commit_msg>Stopped propagation of modal overlay clicks. Added optional onClick handler.<commit_after>import Portal from 'widget/portal'
import PropTypes from 'prop-types'
import React from 'react'
import styles from './modal.module.css'

export const Modal = ({onClick, children}) =>
    <Portal>
        <div className={styles.modal} onClick={e => {
            e.stopPropagation()
            onClick && onClick()
        }}>
            {children}
        </div>
    </Portal>

Modal.propTypes = {
    children: PropTypes.any.isRequired,
    onClick: PropTypes.func
}
{'fraction_non_alphanumeric': 0.12324324324324325, 'fraction_numerical': 0.0, 'mean_word_length': 2.9404255319148938, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '4879043', 'n_tokens_mistral': 262, 'n_tokens_neox': 266, 'n_words': 74}