import React from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; import { useSearchParams } from "next/navigation"; // 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 searchParams = useSearchParams(); const next_path = searchParams.get("next_path"); // 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}
); });