"use client"; import { Link, usePathname } from "@/i18n/routing"; import { getInfoProfile, getListPorvinces, getUsersTeams } from "@/service/landing/landing"; import { Icon } from "@iconify/react/dist/iconify.js"; import React, { useEffect, useState } from "react"; import { useParams } from "next/navigation"; import { useTranslations } from "next-intl"; const SidebarManagement = () => { const [profile, setProfile] = useState(); const [province, setProvince] = useState([]); const [, setUser] = useState(); const [selectedTab, setSelectedTab] = useState("video"); const params = useParams(); const pathname = usePathname(); const t = useTranslations("LandingPage"); // const currentRoute = router.pathname; // const profilePicture = Cookies.get("profile_picture"); useEffect(() => { async function initState() { const response = await getInfoProfile(); setProfile(response?.data?.data); } async function getProvinces() { const response = await getListPorvinces(); // console.log(response?.data?.data); setProvince(response?.data?.data); } // async function getDisticts() { // const response = await getListDistricts(); // console.log(response?.data?.data); // setDistrict(response?.data?.data); // } initState(); getProvinces(); // getDisticts(); }, []); useEffect(() => { async function initState() { if (profile != undefined) { const response = await getUsersTeams(profile?.instituteId); // console.log(response?.data?.data); setUser(response?.data?.data); } } initState(); }, [profile]); function addDefaultProfile(ev: any) { ev.target.src = "/assets/avatar-profile.png"; } const [hasMounted, setHasMounted] = useState(false); // Hooks useEffect(() => { setHasMounted(true); }, []); // Render if (!hasMounted) return null; return (

{t("aboutMe", { defaultValue: "About Me" })}

  • Email :

    {profile?.email}

  • {t("number", { defaultValue: "Number" })} :

    {profile?.phoneNumber}

  • {t("address", { defaultValue: "Address" })} :

    {profile?.address}

  • {t("category", { defaultValue: "Category" })} :

    {profile?.institute?.categoryRole?.name}

  • {t("company", { defaultValue: "Company" })} :

    {profile?.institute?.name}

{t("gallery", { defaultValue: "Gallery" })} {profile?.institute?.name}

{t("myGallery", { defaultValue: "My Gallery" })}

{t("gallery", { defaultValue: "Gallery" })} Rewrite

{t("userTeam", { defaultValue: "User Team" })}

); }; export default SidebarManagement;