import React from 'react';
import { useRouter } from 'next/router';

import Page from './page';

function NotPermitted() {
  const router = useRouter();
  const hideHomeButton = !!router.query['without-pages'];

  return (
    <Page
      title="Page without permissions"
      description="Sorry, you don`t have permissions to access this page"
      linkText={
        !hideHomeButton ? (
          <>
            Go to&nbsp;
            <strong>home page</strong>
          </>
        ) : null
      }
    />
  );
}

export default NotPermitted;
