<commit_before>import React, { Component } from 'react'
import { observer } from 'mobx-react'
import { Tabs } from 'antd'
import './index.less'

const TabPane = Tabs.TabPane

@observer
export default class Sidebar extends Component {
  render() {
    return (
      <div id="sidebar">
        <Tabs defaultActiveKey="1">
          <TabPane tab="Tab 1" key="1">
            sidebar
            {/*<Collection key="recent"/>
             <Collection key="trash"/>
             <Notebooks/>*/}
          </TabPane>
          <TabPane tab="Tab 2" key="2">

          </TabPane>
        </Tabs>
      </div>
    )
  }
}<commit_msg>localStore disassembled and best practice added<commit_after>import React, { Component } from 'react'
import { observable, action, computed } from 'mobx'
import { observer } from 'mobx-react'
import { Radio } from 'antd'
import './index.less'

// import Collection from 'Collection'

const tabContentMap = {
  0: <div>test1</div>,
  1: <div>test2</div>
}

class LocalStore {
  @observable tabIndex = 0

  @action changeTab(index) {
    this.tabIndex = index
  }

  @computed get tabContent() {
    return tabContentMap[this.tabIndex]
  }
}

@observer
export default class Sidebar extends Component {
  constructor(props) {
    super(props)

    this.store = new LocalStore()
  }

  handleTabChange = (e) => {
    this.store.changeTab(e.target.value)
  }

  render() {
    return (
      <div id="sidebar">
        <Radio.Group value={this.store.tabIndex} onChange={this.handleTabChange}>
          <Radio.Button value={0}>Notebooks</Radio.Button>
          <Radio.Button value={1}>Tags</Radio.Button>
        </Radio.Group>
        {this.store.tabContent}
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.14009378663540445, 'fraction_numerical': 0.007033997655334115, 'mean_word_length': 2.6396588486140726, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 27, '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': '7637851', 'n_tokens_mistral': 552, 'n_tokens_neox': 534, 'n_words': 128}