import React, { useState } from "react"; import { observer } from "mobx-react-lite"; import { Dialog, Transition } from "@headlessui/react"; import { AlertTriangle } from "lucide-react"; // hooks import { useUser } from "hooks/store"; // ui import { Button } from "@plane/ui"; type Props = { isOpen: boolean; onClose: () => void; onSubmit: () => Promise; userDetails: { id: string; display_name: string; }; }; export const ConfirmWorkspaceMemberRemove: React.FC = observer((props) => { const { isOpen, onClose, onSubmit, userDetails } = props; // states const [isRemoving, setIsRemoving] = useState(false); // store hooks const { 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.

)}
); });