{"size": 691, "ext": "js", "max_stars_repo_path": "src/containers/TheLayout.js", "max_stars_repo_name": "sharanjeetsingh007/Canteen-Management-System", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/containers/TheLayout.js", "max_issues_repo_name": "sharanjeetsingh007/Canteen-Management-System", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/containers/TheLayout.js", "max_forks_repo_name": "sharanjeetsingh007/Canteen-Management-System", "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": 19.7428571429, "max_line_length": 48, "alphanum_fraction": 0.497829233}
import React from 'react';
import { getUser } from 'src/common'
import {
  TheContent,
  TheSidebar,
  TheFooter,
  TheHeader
} from './index';

import { Redirect } from 'react-router-dom';

const TheLayout = () => {
    const user = getUser();
    console.log(user);
    if (!user)
    {
        return (<Redirect to="/login" />);
    }

    return (
        <div className="c-app c-default-layout">
            <TheSidebar/>
            <div className="c-wrapper">
                <TheHeader/>
                <div className="c-body">
                    <TheContent/>
                </div>
                <TheFooter/>
            </div>
        </div>
    )
}

export default TheLayout
