import { useState, Fragment } from "react"; import { Transition, Dialog } from "@headlessui/react"; // ui import { Button } from "@plane/ui"; // types import type { IProject } from "types"; // lib import { useMobxStore } from "lib/mobx/store-provider"; // type type TJoinProjectModalProps = { isOpen: boolean; workspaceSlug: string; project: IProject; handleClose: () => void; }; export const JoinProjectModal: React.FC = (props) => { const { handleClose, isOpen, project, workspaceSlug } = props; // store const { project: projectStore } = useMobxStore(); // states const [isJoiningLoading, setIsJoiningLoading] = useState(false); const handleJoin = () => { setIsJoiningLoading(true); projectStore .joinProject(workspaceSlug, [project.id]) .then(() => { setIsJoiningLoading(false); handleClose(); }) .catch(() => { setIsJoiningLoading(false); }); }; return (
Join Project?

Are you sure you want to join the project {project?.name}? Please click the 'Join Project' button below to continue.

); };