{"size": 1098, "ext": "js", "max_stars_repo_path": "src/components/Events/index.js", "max_stars_repo_name": "nikoisonfire/jamfony-beta-v1", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Events/index.js", "max_issues_repo_name": "nikoisonfire/jamfony-beta-v1", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Events/index.js", "max_forks_repo_name": "nikoisonfire/jamfony-beta-v1", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8947368421, "max_line_length": 73, "alphanum_fraction": 0.5063752277}
import React, {lazy, Suspense} from 'react';
import {AuthRoute} from "../App";
import {Switch} from "react-router-dom";
import Loader from "../Widgets/Loader";


const Event = lazy(() => import("./Event"));
const CreateEvent = lazy(() => import("./CreateEvent"));
const EditEvent = lazy(() => import("./EditEvent"));
const EventsLanding = lazy(() => import("../Landings/EventsLanding"));

/**
 * Router for /events.
 */
const Events = ({match}) => {

    return (
        <Suspense fallback={<Loader/>}>
            <Switch>
                <AuthRoute exact path={match.url + "/edit/:editEventId"}>
                    <EditEvent/>
                </AuthRoute>
                <AuthRoute exact path={match.url + "/create"}>
                    <CreateEvent/>
                </AuthRoute>
                <AuthRoute exact path={match.url}>
                    <EventsLanding/>
                </AuthRoute>
                <AuthRoute path={match.url + "/:eventId"}>
                    <Event/>
                </AuthRoute>
            </Switch>
        </Suspense>
    );
};

export default Events;
