mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
fix(admin and normal user): admin and normal user
This commit is contained in:
+13
-3
@@ -8,19 +8,29 @@ import LineChart from "@/components/graph/LineChart";
|
||||
import { Box } from "@chakra-ui/react";
|
||||
import { websiteName } from "@/lib/constants";
|
||||
import { useRef, useEffect } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import type { Session } from "@/models/auth/Session";
|
||||
import { Role } from "@prisma/client";
|
||||
|
||||
export default function Graphique() {
|
||||
const { data: session, status } = useSession({ required: true });
|
||||
const { user } = session as unknown as Session;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{websiteName}</title>
|
||||
</Head>
|
||||
|
||||
{user.role === Role.ADMIN ? (
|
||||
<Box>
|
||||
{/* <PieChart /> */}
|
||||
{/* <BarChart /> */}
|
||||
<PieChart />
|
||||
<BarChart />
|
||||
<LineChart />
|
||||
</Box>
|
||||
) : (
|
||||
// pour récupérer les notifs d'un user
|
||||
//fetch(`/api/users/${user.id}?include=Notification`)
|
||||
<></>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user