<commit_before>import PropTypes from 'prop-types'
import React from 'react'
import {PreviewAny} from './utils/fallback-preview/PreviewAny'

type PreviewProps = {
  actions?: React.ReactNode
  layout?: string
  value?: any
  type: any
  fallbackTitle?: React.ReactNode
}
export default class Preview extends React.PureComponent<PreviewProps> {
  static contextTypes = {
    formBuilder: PropTypes.object,
  }

  render() {
    const {type, value} = this.props

    const PreviewComponent = this.context.formBuilder.resolvePreviewComponent(type)

    if (PreviewComponent) {
      return <PreviewComponent {...this.props} />
    }

    return (
      <div title="Unable to resolve preview component. Using fallback.">
        <PreviewAny value={value} maxDepth={2} />
      </div>
    )
  }
}<commit_msg>feat(form-builder): add `withRadius` and `withBorder` props to `Preview`<commit_after>import PropTypes from 'prop-types'
import React from 'react'
import {PreviewAny} from './utils/fallback-preview/PreviewAny'

type PreviewProps = {
  actions?: React.ReactNode
  layout?: string
  value?: any
  type: any
  fallbackTitle?: React.ReactNode
  withRadius?: boolean
  withBorder?: boolean
}
export default class Preview extends React.PureComponent<PreviewProps> {
  static contextTypes = {
    formBuilder: PropTypes.object,
  }

  render() {
    const {type, value} = this.props

    const PreviewComponent = this.context.formBuilder.resolvePreviewComponent(type)

    if (PreviewComponent) {
      return <PreviewComponent {...this.props} />
    }

    return (
      <div title="Unable to resolve preview component. Using fallback.">
        <PreviewAny value={value} maxDepth={2} />
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.1146869514335869, 'fraction_numerical': 0.0011702750146284377, 'mean_word_length': 3.6091644204851754, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5316236', 'n_tokens_mistral': 501, 'n_tokens_neox': 499, 'n_words': 131}