feat: add unauthorized state

This commit is contained in:
nafees nazik
2024-07-17 13:40:08 +05:30
parent c4b2c0a37c
commit fae1c4f2fd
3 changed files with 17 additions and 2 deletions
@@ -1,4 +1,5 @@
import { CompanyForm } from "@/components/onboarding/company-form";
import { UnAuthorizedState } from "@/components/ui/un-authorized-state";
import { serverAccessControl } from "@/lib/rbac/access-control";
import { api } from "@/trpc/server";
import type { Metadata } from "next";
@@ -15,7 +16,7 @@ const CompanySettingsPage = async () => {
]);
if (!data?.company) {
return <div>un authenticated</div>;
return <UnAuthorizedState />;
}
return <CompanyForm data={data} type="edit" />;
+1 -1
View File
@@ -11,7 +11,7 @@
import { cn } from "@/lib/utils";
type EmptyStateProps = {
export type EmptyStateProps = {
title?: string;
bordered?: boolean;
subtitle: string | React.ReactNode;
+14
View File
@@ -0,0 +1,14 @@
import { RiProhibitedLine } from "@remixicon/react";
import EmptyState, { type EmptyStateProps } from "../common/empty-state";
export function UnAuthorizedState(props: Partial<EmptyStateProps>) {
return (
<EmptyState
bordered={false}
icon={<RiProhibitedLine />}
title="Un Authorized"
subtitle="you don't have access to view this content."
{...props}
/>
);
}