<commit_before>import React from 'react'
import {connect} from 'react-redux'
import JsonVision from 'json-vision'
import {DialogComp} from 'spaceman'
import treeSettings from './treeSettings'
import itemSettings from './itemSettings'

@connect(() => {
  const projectManager = BETON.getRock('project-manager')
  const pmStore = projectManager.selectors.getProjectManager()
  const {items, lastSelectedItemId} = pmStore
  return {
    lastSelectedItemId,
    items,
    actions: projectManager.actions,
  }
})
export default class DialogComponent extends React.Component {
  render() {
    const {items, lastSelectedItemId, actions, onClose} = this.props
    const selectedItem = items.find(item => lastSelectedItemId === item.id)
    console.log({selectedItem, lastSelectedItemId})

    return <DialogComp
        title = 'Item settigns'
        buttons = {[{label: 'close', onClick: onClose}]}
        onClose = {onClose}>
      <div style={{display: 'flex', width: 432, height: 453}}>
        <JsonVision
          settings={treeSettings}
          value={{}}
          style={{flex: 1}}
        />
      <JsonVision
          settings={itemSettings}
          value={selectedItem}
          style={{flex: 1}}
        />
      </div>
    </DialogComp>
  }
}<commit_msg>wip:scrollable item settings dialog<commit_after>import React from 'react'
import {connect} from 'react-redux'
import JsonVision from 'json-vision'
import {DialogComp} from 'spaceman'
import treeSettings from './treeSettings'
import itemSettings from './itemSettings'
import {Scrollable} from 'react-matterkit'

@connect(() => {
  const projectManager = BETON.getRock('project-manager')
  const pmStore = projectManager.selectors.getProjectManager()
  const {items, lastSelectedItemId} = pmStore
  return {
    lastSelectedItemId,
    items,
    actions: projectManager.actions,
  }
})
export default class DialogComponent extends React.Component {
  render() {
    const {items, lastSelectedItemId, actions, onClose} = this.props
    const selectedItem = items.find(item => lastSelectedItemId === item.id)
    console.log({selectedItem, lastSelectedItemId})

    return <DialogComp
        title = 'Item settigns'
        buttons = {[{label: 'close', onClick: onClose}]}
        onClose = {onClose}>
      <Scrollable style={{display: 'flex', width: 432, height: 453}}>
        <JsonVision
          settings={treeSettings}
          value={{}}
          style={{flex: 1}}
        />
        <JsonVision
          settings={itemSettings}
          value={selectedItem}
          style={{flex: 1}}
        />
      </Scrollable>
    </DialogComp>
  }
}
{'fraction_non_alphanumeric': 0.12352268394967594, 'fraction_numerical': 0.006099885627144491, 'mean_word_length': 3.2254428341384864, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '132711', 'n_tokens_mistral': 764, 'n_tokens_neox': 745, 'n_words': 189}