/* oxlint-disable react/no-unescaped-entities */
import { WarningIcon } from "outline-icons";
import { Trans } from "react-i18next";
import Notice from "~/components/Notice";
import useQuery from "~/hooks/useQuery";
function Message({ notice }: { notice: string }) {
switch (notice) {
case "invalid-code":
return (
Sorry, the code you entered is invalid or has expired.
);
case "domain-not-allowed":
return (
The domain associated with your email address has not been allowed for
this workspace.
);
case "domain-required":
return (
Unable to sign-in. Please navigate to your workspace's custom URL,
then try to sign-in again.
If you were invited to a workspace, you will find a link to it in the
invite email.
);
case "gmail-account-creation":
return (
Sorry, a new account cannot be created with a personal Gmail address.
Please use a Google Workspaces account instead.
);
case "pending-deletion":
return (
The workspace associated with your user is scheduled for deletion and
cannot be accessed at this time.
);
case "maximum-reached":
return (
The workspace you authenticated with is not authorized on this
installation. Try another?
);
case "malformed-user-info":
return (
We could not read the user info supplied by your identity provider.
);
case "email-auth-required":
return (
Your account uses email sign-in, please sign-in with email to
continue.
);
case "email-auth-ratelimit":
return (
An email sign-in link was recently sent, please check your inbox or
try again in a few minutes.
);
case "auth-error":
case "state-mismatch":
return (
Authentication failed – we were unable to sign you in at this time.
Please try again.
);
case "invalid-authentication":
return (
Authentication failed – you do not have permission to access this
workspace.
);
case "expired-token":
return (
Sorry, it looks like that sign-in link is no longer valid, please try
requesting another.
);
case "user-suspended":
return (
Your account has been suspended. To re-activate your account, please
contact a workspace admin.
);
case "team-suspended":
return (
This workspace has been suspended. Please contact support to restore
access.
);
case "authentication-provider-disabled":
return (
Authentication failed – this login method was disabled by a workspace
admin.
);
case "invite-required":
return (
The workspace you are trying to join requires an invite before you can
create an account.
Please request an invite from your workspace admin and try again.
);
default:
return Sorry, an unknown error occurred.;
}
}
export function Notices() {
const query = useQuery();
const notice = query.get("notice");
if (!notice) {
return null;
}
return (
}>
);
}