import { FC, useState } from "react"; import { observer } from "mobx-react"; import { ChevronDown } from "lucide-react"; import { Menu, Transition } from "@headlessui/react"; // ui import { Avatar } from "@plane/ui"; // hooks import { useUser } from "@/hooks/store"; // components import { SwitchOrDeleteAccountModal } from "./switch-delete-account-modal"; type TSwithOrDeleteAccountDropdownProps = { fullName?: string; }; export const SwitchOrDeleteAccountDropdown: FC = observer((props) => { const { fullName } = props; // states const [showDeleteAccountModal, setShowDeleteAccountModal] = useState(false); // store hooks const { data: user } = useUser(); return (
setShowDeleteAccountModal(false)} />
{user?.avatar && ( 0 ? fullName : user?.email } src={user?.avatar} size={24} shape="square" fallbackBackgroundColor="#FCBE1D" className="!text-base capitalize" /> )}

{user?.first_name ? `${user?.first_name} ${user?.last_name ?? ""}` : fullName && fullName.trim().length > 0 ? fullName : user?.email}

{ setShowDeleteAccountModal(true); }} > Wrong e-mail address?
); });