import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import moment from 'moment-jalaali';
import HomePage from './components/home';
import LoginPage from './components/login';
import CreateCardPage from './components/create-card';
import CardsPage from './components/cards';
import DefaultPage from './components/default';

function App() {
  return (
    <Router basename={process.env.PUBLIC_URL}>
      <Switch>
        <Route exact path='/' component={HomePage} />
        <Route exact path='/login' component={LoginPage} />
        <Route path='/cards/create' component={CreateCardPage} />
        <Route path='/cards' component={CardsPage} />
        <Route path='*' component={DefaultPage} />
      </Switch>
    </Router>
  );
}

moment.loadPersian({ usePersianDigits: false, dialect: 'persian-modern' });

export default App;
