import React, { useState } from "react"; import { observer } from "mobx-react"; import { AlertTriangle } from "lucide-react"; import { Dialog, Transition } from "@headlessui/react"; import { Button } from "@plane/ui"; import { useUser } from "@/hooks/store"; import { Props } from "./confirm-workspace-member-remove"; export const ConfirmWorkspaceMemberRemove: React.FC = observer((props) => { const { isOpen, onClose, onSubmit, userDetails } = props; // states const [isRemoving, setIsRemoving] = useState(false); // store hooks const { data: currentUser } = useUser(); const handleClose = () => { onClose(); setIsRemoving(false); }; const handleDeletion = async () => { setIsRemoving(true); await onSubmit(); handleClose(); }; return (
{currentUser?.id === userDetails.id ? "Leave workspace?" : `Remove ${userDetails?.display_name}?`}
{currentUser?.id === userDetails.id ? (

Are you sure you want to leave the workspace? You will no longer have access to this workspace. This action cannot be undone.

) : (

Are you sure you want to remove member-{" "} {userDetails?.display_name}? They will no longer have access to this workspace. This action cannot be undone.

)}
); });