import React from "react";
import PropTypes from "prop-types";
import { ToastContainer, toast } from "react-toastify";

import Navbar from "../navbar";
import Footer from "../footer";

toast.configure();

const Layout = ({ children }) => {
	return (
		<>
			<Navbar />
			<main>{children}</main>
			<ToastContainer
				position="bottom-center"
				autoClose={3000}
				newestOnTop
				hideProgressBar
				closeOnClick
				pauseOnFocusLoss={false}
				draggable
				pauseOnHover
			/>
			<Footer />
		</>
	);
};

Layout.propTypes = {
	children: PropTypes.node.isRequired
};

export default Layout;
