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 { Box } from "@chakra-ui/react";
|
||||||
import { websiteName } from "@/lib/constants";
|
import { websiteName } from "@/lib/constants";
|
||||||
import { useRef, useEffect } from "react";
|
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() {
|
export default function Graphique() {
|
||||||
|
const { data: session, status } = useSession({ required: true });
|
||||||
|
const { user } = session as unknown as Session;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{websiteName}</title>
|
<title>{websiteName}</title>
|
||||||
</Head>
|
</Head>
|
||||||
|
{user.role === Role.ADMIN ? (
|
||||||
<Box>
|
<Box>
|
||||||
{/* <PieChart /> */}
|
<PieChart />
|
||||||
{/* <BarChart /> */}
|
<BarChart />
|
||||||
<LineChart />
|
<LineChart />
|
||||||
</Box>
|
</Box>
|
||||||
|
) : (
|
||||||
|
// pour récupérer les notifs d'un user
|
||||||
|
//fetch(`/api/users/${user.id}?include=Notification`)
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user