<commit_before>import React from 'react'

import {
  Container,
  InfoTooltip,
  Item,
  ItemList,
  KeyboardShortcut,
  SearchBar,
  SectionAction,
  SidePanel,
  SidePanelSection,
  SplashScreen
} from 'botpress/ui'

// This view is a sample including all the features of Botpress UI
export default class MyMainView extends React.Component {
  state = {
    selectedId: 1,
    loaded: false
  }

  handleItemSelected = (item: Item) => console.log('Selected object:', item)
  handleSearchChanged = value => console.log(value)
  handleSearchClicked = () => console.log('Search clicked')
  handleContextClicked = item => console.log('Item: ', item)
  test = () => console.log('clicked button')

  render() {
    const actions: SectionAction[] = [
      {
        label: 'File',
        icon: 'add', // can also be an icon as jsx element, ex: <MdLibraryAdd />,
        items: [
          { label: 'Open', icon: 'folder-open', onClick: this.test },
          { label: 'New', icon: 'folder-new', onClick: this.test },
          { label: 'Save', icon: 'floppy-disk', onClick: this.test },
          { type: 'divider' },
          { label: 'Delete', icon: 'trash', onClick: this.test }
        ]
      }
    ]

    const items: Item[] = [
      {
        label: 'My element',
        value: { id: 1, something: '/' },
        selected: this.state.selectedId === 1,
        actions: [
          {
            tooltip: 'Create new',
            icon: 'add',
            onClick: this.test
          }
        ],
        contextMenu: [{ label: 'Some action', onClick: () => this.handleContextClicked({ id: 1 }) }]
      },
      {
        label: 'My second element',
        value: { id: 2, name: 'lalal' },
        selected: this.state.selectedId === 2
      }
      // ...
    ]

    return (
      <Container>
        <SidePanel>
          <SearchBar onChange={this.handleSearchChanged} onClick={this.handleSearchClicked} />
          <SidePanelSection label={'My Files'} actions={actions}><commit_msg>fix(examples) custom-module: Compilation error (#2344)<commit_after>import React from 'react'

import {
  Container,
  InfoTooltip,
  Item,
  ItemList,
  KeyboardShortcut,
  SearchBar,
  SectionAction,
  SidePanel,
  SidePanelSection,
  SplashScreen
} from 'botpress/ui'

// This view is a sample including all the features of Botpress UI
export default class MyMainView extends React.Component {
  state = {
    selectedId: 1,
    loaded: false
  }

  handleItemSelected = (item: Item) => console.log('Selected object:', item)
  handleSearchChanged = value => console.log(value)
  handleSearchClicked = () => console.log('Search clicked')
  handleContextClicked = item => console.log('Item: ', item)
  test = () => console.log('clicked button')

  render() {
    const actions: SectionAction[] = [
      {
        label: 'File',
        icon: 'add', // can also be an icon as jsx element, ex: <MdLibraryAdd />,
        items: [
          { label: 'Open', icon: 'folder-open', onClick: this.test },
          { label: 'New', icon: 'folder-new', onClick: this.test },
          { label: 'Save', icon: 'floppy-disk', onClick: this.test },
          { type: 'divider' },
          { label: 'Delete', icon: 'trash', onClick: this.test }
        ]
      }
    ]

    const items: Item[] = [
      {
        label: 'My element',
        value: { id: 1, something: '/' },
        selected: this.state.selectedId === 1,
        actions: [
          {
            tooltip: 'Create new',
            icon: 'add',
            onClick: this.test
          }
        ],
        contextMenu: [{ label: 'Some action', onClick: () => this.handleContextClicked({ id: 1 }) }]
      },
      {
        label: 'My second element',
        value: { id: 2, name: 'lalal' },
        selected: this.state.selectedId === 2
      }
      // ...
    ]

    return (
      <Container>
        <SidePanel>
          <SearchBar onChange={this.handleSearchChanged} onButtonClick={this.handleSearchClicked} />
          <SidePanelSection label={'My Files'} actions={actions}>
{'fraction_non_alphanumeric': 0.14335231492943798, 'fraction_numerical': 0.003961376578360981, 'mean_word_length': 2.2899022801302933, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, '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': '373801', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1201, 'n_words': 313}