import React, { useState } from "react"; import { observer } from "mobx-react-lite"; import { Dialog, Transition } from "@headlessui/react"; import { AlertTriangle } from "lucide-react"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // ui import { Button } from "@plane/ui"; type Props = { isOpen: boolean; onClose: () => void; onSubmit: () => Promise; data?: any; }; export const ConfirmWorkspaceMemberRemove: React.FC = observer((props) => { const { isOpen, onClose, data, onSubmit } = props; const [isRemoving, setIsRemoving] = useState(false); const { user: userStore } = useMobxStore(); const user = userStore.currentUser; const handleClose = () => { onClose(); setIsRemoving(false); }; const handleDeletion = async () => { setIsRemoving(true); await onSubmit(); handleClose(); }; return (
{user?.id === data?.memberId ? "Leave workspace?" : `Remove ${data?.display_name}?`}
{user?.id === data?.memberId ? (

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-{" "} {data?.display_name}? They will no longer have access to this workspace. This action cannot be undone.

)}
); });