fix
This commit is contained in:
@@ -4,13 +4,14 @@ import Header from "@/components/header";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useTranslations } from "next-intl";
|
||||
import type { Consent, User } from "@/types";
|
||||
import { AppWindowMacIcon, BriefcaseBusinessIcon, LogOutIcon, UserIcon } from "lucide-react";
|
||||
import { AppWindowMacIcon, BriefcaseBusinessIcon, LogOutIcon, ShieldIcon, UserIcon } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useState } from "react";
|
||||
import { Logout } from "@/actions/auth";
|
||||
import Profile from "./items/profile";
|
||||
import Applications from "./items/applications";
|
||||
import Positions from "./items/positions";
|
||||
import Admin from "./items/admin";
|
||||
|
||||
interface Props {
|
||||
userData: User | null;
|
||||
@@ -24,12 +25,19 @@ export default function MeClient({ userData, consentsData }: Props) {
|
||||
const [consents, setConsents] = useState(consentsData)
|
||||
const [selectedItem, setSelectedItem] = useState(0);
|
||||
|
||||
const items = [
|
||||
{"name": t("items.profile.title"), "icon": <UserIcon />, "component": <Profile user={user} setUser={setUser} />},
|
||||
{"name": t("items.applications.title"), "icon": <AppWindowMacIcon />, "component": <Applications consents={consents} setConsents={setConsents} />},
|
||||
{"name": t("items.positions.title"), "icon": <BriefcaseBusinessIcon />, "component": <Positions />},
|
||||
|
||||
const baseItems = [
|
||||
{ name: t("items.profile.title"), icon: <UserIcon />, component: <Profile user={user} setUser={setUser} /> },
|
||||
{ name: t("items.applications.title"), icon: <AppWindowMacIcon />, component: <Applications consents={consents} setConsents={setConsents} /> },
|
||||
{ name: t("items.positions.title"), icon: <BriefcaseBusinessIcon />, component: <Positions /> },
|
||||
]
|
||||
|
||||
const adminItem = user?.is_admin
|
||||
? [{ name: t("items.admin.title"), icon: <ShieldIcon />, component: <Admin /> }]
|
||||
: []
|
||||
|
||||
const items = [...baseItems, ...adminItem]
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
|
||||
Reference in New Issue
Block a user