"use client" 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 { Button } from "@/components/ui/button"; import { useState } from "react"; import { Logout } from "@/actions/auth"; import Profile from "./items/profile"; import Applications from "./items/applications"; interface Props { userData: User | null; consentsData: Consent[] | []; } export default function MeClient({ userData, consentsData }: Props) { const t = useTranslations("MePage"); const [user, setUser] = useState(userData); const [consents, setConsents] = useState(consentsData) const [selectedItem, setSelectedItem] = useState(0); const items = [ {"name": t("items.profile.title"), "icon": , "component": }, {"name": t("items.applications.title"), "icon": , "component": }, {"name": t("items.positions.title"), "icon": }, ] return ( <>
{!user ? (
) : (

{user.first_name} {user.second_name}

{user.email}

{ items.map((item, index) => ( )) }
{items[selectedItem].component}
)}
); }