added better error messages if config secret permission is missing

This commit is contained in:
dswbx
2025-01-18 13:31:33 +01:00
parent db10188945
commit fb2dff956b
9 changed files with 72 additions and 25 deletions

View File

@@ -1,9 +1,24 @@
import { IconLockAccessOff } from "@tabler/icons-react";
import { Empty, type EmptyProps } from "./Empty";
const NotFound = (props: Partial<EmptyProps>) => <Empty title="Not Found" {...props} />;
const NotAllowed = (props: Partial<EmptyProps>) => <Empty title="Not Allowed" {...props} />;
const MissingPermission = ({
what,
...props
}: Partial<EmptyProps> & {
what?: string;
}) => (
<Empty
Icon={IconLockAccessOff}
title="Missing Permission"
description={`You're not allowed to access ${what ?? "this"}.`}
{...props}
/>
);
export const Message = {
NotFound,
NotAllowed
NotAllowed,
MissingPermission
};