import React from 'react';
import { Helmet } from 'react-helmet';
import { Global } from '@emotion/react'
import { BrowserRouter } from 'react-router-dom';
import ruLocale from 'dayjs/locale/ru';
import dayjs from 'dayjs';
import { ChakraProvider } from '@chakra-ui/react'

import { Dashboard } from './dashboard';
import { globalStyles } from './global.styles';

dayjs.locale('ru', ruLocale);

const App = ({ store }) => (
    <ChakraProvider>
        <BrowserRouter>
            <Helmet>
                <meta name="viewport" content="width=device-width, user-scalable=no" />
                <title>Журнал</title>
            </Helmet>
            <Global styles={globalStyles} />
            <Dashboard store={store} />
        </BrowserRouter>
    </ChakraProvider>
)

export default App;

