import { Button, Input, Textarea } from "@mui/joy"; import { useUserStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import showChangePasswordDialog from "../ChangePasswordDialog"; import { showCommonDialog } from "../Dialog/CommonDialog"; import Icon from "../Icon"; import showUpdateAccountDialog from "../UpdateAccountDialog"; import UserAvatar from "../UserAvatar"; const MyAccountSection = () => { const t = useTranslate(); const userStore = useUserStore(); const user = userStore.state.user as User; const openAPIRoute = `${window.location.origin}/api/v1/memo?openId=${user.openId}`; const handleResetOpenIdBtnClick = async () => { showCommonDialog({ title: t("setting.account-section.openapi-reset"), content: t("setting.account-section.openapi-reset-warning"), style: "warning", dialogName: "reset-openid-dialog", onConfirm: async () => { await userStore.patchUser({ id: user.id, resetOpenId: true, }); }, }); }; const exampleWithCurl = `curl '${openAPIRoute}' -H 'Content-Type: application/json' --data-raw '{"content":"Hello world!"}'`; return ( <>

{t("setting.account-section.title")}

{user.nickname} ({user.username})
{user.email}

Open ID

Open API Example with cURL