<commit_before>import React from "react"
import { Helmet } from "react-helmet"
import path from "path"
import { observer, inject } from "mobx-react"
import DevTools from "mobx-react-devtools"

import TempoEditor from "containers/TempoEditor/TempoEditor"
import ArrangeView from "containers/ArrangeView/ArrangeView"
import TransportPanel from "containers/TransportPanel/TransportPanel"
import PianoRollEditor from "containers/PianoRollEditor/PianoRollEditor"
import SettingsView from "containers/SettingsView/SettingsView"

import mainManu from "menus/mainMenu"

import "./Resizer.css"
import "./RootView.css"

const { remote } = window.require("electron")
const { Menu } = remote

function RootView({
  player,
  song,
  dispatch,
  routerPath,
}) {
  const { selectedTrack } = song

  const menu = mainManu(song, dispatch)
  Menu.setApplicationMenu(menu)

  const fileName = path.basename(song.filepath.replace(/\\/g, "/"))

  function withTransporter(content) {
    return [content, <TransportPanel />]
  }

  function router() {
    switch (routerPath) {
      case "/track": return selectedTrack.isConductorTrack ? withTransporter(<TempoEditor />) : withTransporter(<PianoRollEditor />)
      case "/settings": return <SettingsView />
      case "/arrange": /* fallthrough */
      default:
        return withTransporter(<ArrangeView />)
    }
  }

  return <div className="RootView">
    <Helmet><title>{`${song.name} (${fileName}) ― signal`}</title></Helmet>
    {router()}
    <DevTools />
  </div>
}

export default inject(({ rootStore: { pianoRollStore, router: { path }, song, services: { player }, dispatch } }) => ({
  routerPath: path,
  song,
  player,
  dispatch
}))(observer(RootView))<commit_msg>Hide devtool in the production<commit_after>import React from "react"
import { Helmet } from "react-helmet"
import path from "path"
import { observer, inject } from "mobx-react"
import DevTools from "mobx-react-devtools"

import TempoEditor from "containers/TempoEditor/TempoEditor"
import ArrangeView from "containers/ArrangeView/ArrangeView"
import TransportPanel from "containers/TransportPanel/TransportPanel"
import PianoRollEditor from "containers/PianoRollEditor/PianoRollEditor"
import SettingsView from "containers/SettingsView/SettingsView"

import mainManu from "menus/mainMenu"

import "./Resizer.css"
import "./RootView.css"

const { remote } = window.require("electron")
const { Menu } = remote

const isDev = process.env.NODE_ENV !== "production"

function RootView({
  player,
  song,
  dispatch,
  routerPath,
}) {
  const { selectedTrack } = song

  const menu = mainManu(song, dispatch)
  Menu.setApplicationMenu(menu)

  const fileName = path.basename(song.filepath.replace(/\\/g, "/"))

  function withTransporter(content) {
    return [content, <TransportPanel />]
  }

  function router() {
    switch (routerPath) {
      case "/track": return selectedTrack.isConductorTrack ? withTransporter(<TempoEditor />) : withTransporter(<PianoRollEditor />)
      case "/settings": return <SettingsView />
      case "/arrange": /* fallthrough */
      default:
        return withTransporter(<ArrangeView />)
    }
  }

  return <div className="RootView">
    <Helmet><title>{`${song.name} (${fileName}) ― signal`}</title></Helmet>
    {router()}
    {isDev && <DevTools />}
  </div>
}

export default inject(({ rootStore: { pianoRollStore, router: { path }, song, services: { player }, dispatch } }) => ({
  routerPath: path,
  song,
  player,
  dispatch
}))(observer(RootView))
{'fraction_non_alphanumeric': 0.13451125676831005, 'fraction_numerical': 0.0, 'mean_word_length': 4.4, 'pattern_counts': {'":': 6, '<': 27, '<?xml version=': 0, '>': 29, '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': '4920731', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1057, 'n_words': 256}