Working on role in workspace.

This commit is contained in:
charles-gauthereau
2024-12-31 10:54:18 +01:00
parent e1a7ca8558
commit 6f75079a40
29 changed files with 464 additions and 124 deletions
@@ -0,0 +1,28 @@
import {PageParams} from "@/types/next";
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
import {AgentForm} from "@/components/wrappers/dashboard/agent/AgentForm/AgentForm";
import {currentUser} from "@/auth/current-user";
import {notFound} from "next/navigation";
export default async function RoutePage(props: PageParams<{}>) {
const user = await currentUser();
if(user.role != "admin"){
notFound()
}
return (
<Page>
<PageHeader>
<PageTitle>
Create new agent
</PageTitle>
</PageHeader>
<PageContent>
<AgentForm/>
</PageContent>
</Page>
)
}