import { BrowserRouter } from 'react-router-dom'
import { UserContextProvider } from './contexts/UserContext'
import { CoreLayout } from './CoreLayout'
import { AppContextProvider } from './contexts/AppContext'

import './app.scss'

const App = () => {
  const baseURL = process.env.REACT_APP_API_URL || '/api'

  return (
    <BrowserRouter>
      <AppContextProvider baseURL={baseURL}>
        <UserContextProvider>
          <CoreLayout />
        </UserContextProvider>
      </AppContextProvider>
    </BrowserRouter>
  )
}

export default App
