import React, { useEffect } from 'react';
import {BrowserRouter, Switch, Route, useLocation} from "react-router-dom";
import Dash from './index'
import SourcesModal from './stats/modals/sources'
import ReferrersDrilldownModal from './stats/modals/referrer-drilldown'
import GoogleKeywordsModal from './stats/modals/google-keywords'
import PagesModal from './stats/modals/pages'
import EntryPagesModal from './stats/modals/entry-pages'
import ExitPagesModal from './stats/modals/exit-pages'
import ModalTable from './stats/modals/table'
import PropsModal from './stats/modals/props'
import ConversionsModal from './stats/modals/conversions'
import FilterModal from './stats/modals/filter-modal'
import * as url from './util/url';
function ScrollToTop() {
const location = useLocation();
useEffect(() => {
if (location.state && location.state.scrollTop) {
window.scrollTo(0, 0);
}
}, [location]);
return null;
}
export default function Router({site, loggedIn, currentUserRole}) {
return (
);
}
function renderCityIcon(city) {
return {city.country_flag}
}
function renderCountryIcon(country) {
return {country.flag}
}
function renderRegionIcon(region) {
return {region.country_flag}
}