import React from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; import { useRouter } from "next/router"; // hooks import { useUser } from "@/hooks/store"; // layouts import DefaultLayout from "@/layouts/default-layout"; // images import ProjectNotAuthorizedImg from "public/auth/project-not-authorized.svg"; import WorkspaceNotAuthorizedImg from "public/auth/workspace-not-authorized.svg"; type Props = { actionButton?: React.ReactNode; type: "project" | "workspace"; }; export const NotAuthorizedView: React.FC = observer((props) => { const { actionButton, type } = props; // router const { query } = useRouter(); const { next_path } = query; // hooks const { data: currentUser } = useUser(); return (
ProjectSettingImg

Oops! You are not authorized to view this page

{currentUser ? (

You have signed in as {currentUser.email}.
Sign in {" "} with different account that has access to this page.

) : (

You need to{" "} Sign in {" "} with an account that has access to this page.

)}
{actionButton}
); });