import React, { useEffect, memo } from 'react';
import { useDispatch } from 'react-redux';
import axios from 'axios';
import DisplayerComponent from './components/Displayer';
import { Template } from './template';
import { fetchExercises, updateUser } from './store/coach';

var App = function App(props) {
  var dispatch = useDispatch();
  useEffect(function () {
    axios.defaults.baseURL = props.baseURL;
    dispatch(updateUser(props.user));
    dispatch(fetchExercises());
  }, [dispatch]);
  return /*#__PURE__*/React.createElement(Template, null, /*#__PURE__*/React.createElement(DisplayerComponent, null));
};

export default memo(App);