import React, {Component} from 'react'
import {configure} from 'mobx'
import {Provider} from 'mobx-react'
import configStore from './stores/configStore'
import KaraSearchComponent from "./components/";

configure({
  enforceActions: true,
  isolateGlobalState: true,
})

class KS extends Component {
  constructor(props) {
    super(props)
  }

  render() {
    configStore.setConfig(this.props.config); // 把配置参数保存到 store
    const stores = {
      configStore,
    };
    return (
      <Provider {...stores} >
        <KaraSearchComponent {...this.props.config}/>
      </Provider>
    )
  }
}

export default KS
