import { Fragment } from 'react'; import Link from 'next/link'; import Cookies from "universal-cookie"; import HeadTag from '../../components/HeadTag'; import FunctionsList from '../../components/FunctionsList/FunctionsList'; import redirect from '../../utils/redirect'; const Admin = (props) => { if (!props.user.isAdmin && typeof window != 'undefined') { return redirect({}, '/404'); } return (

Administration

); } export async function getServerSideProps({ req }) { const cookies = new Cookies(req.headers.cookie); return { props: { user: { ...cookies.get('user') } } }; } export default Admin;