import { Button, Code, Paper, Text } from "@mantine/core"; import { Layout } from "../components/layouts/layout"; import { Navigate } from "react-router"; import { isQueryValid } from "../utils/utils"; export const UnauthorizedPage = () => { const queryString = window.location.search; const params = new URLSearchParams(queryString); const username = params.get("username") ?? ""; const resource = params.get("resource") ?? ""; if (!isQueryValid(username)) { return ; } return ( Unauthorized The user with username {username} is not authorized to{" "} {isQueryValid(resource) ? ( access the {resource} resource. ) : ( "login." )} ); };