import { Button } from "@mui/joy"; import { useState } from "react"; import useUserStore from "../../stores/v1/user"; import ChangePasswordDialog from "../ChangePasswordDialog"; import EditUserinfoDialog from "../EditUserinfoDialog"; const AccountSection: React.FC = () => { const currentUser = useUserStore().getCurrentUser(); const [showEditUserinfoDialog, setShowEditUserinfoDialog] = useState(false); const [showChangePasswordDialog, setShowChangePasswordDialog] = useState(false); const isAdmin = currentUser.role === "ADMIN"; return ( <>

Account

{currentUser.nickname} {isAdmin && Admin}

Email: {currentUser.email}

{showEditUserinfoDialog && setShowEditUserinfoDialog(false)} />} {showChangePasswordDialog && setShowChangePasswordDialog(false)} />} ); }; export default AccountSection;