import React, { useState } from "react"; import { observer } from "mobx-react-lite"; import { AlertTriangle } from "lucide-react"; import { Dialog, Transition } from "@headlessui/react"; import { IUserLite } from "@plane/types"; // hooks import { Button } from "@plane/ui"; import { useUser } from "@/hooks/store"; // ui // types type Props = { data: IUserLite; onSubmit: () => Promise; isOpen: boolean; onClose: () => void; }; export const ConfirmProjectMemberRemove: React.FC = observer((props) => { const { data, onSubmit, isOpen, onClose } = props; // states const [isDeleteLoading, setIsDeleteLoading] = useState(false); // store hooks const { currentUser } = useUser(); const handleClose = () => { onClose(); setIsDeleteLoading(false); }; const handleDeletion = async () => { setIsDeleteLoading(true); await onSubmit(); handleClose(); }; const isCurrentUser = currentUser?.id === data?.id; return (
{isCurrentUser ? "Leave project?" : `Remove ${data?.display_name}?`}

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

); });