import React, { useState } from "react"; import { Transition, Dialog } from "@headlessui/react"; // ui import type { IProject } from "types"; import { Button } from "components/ui"; // type type TJoinProjectModalProps = { data?: IProject; onClose: () => void; onJoin: () => Promise; }; export const JoinProjectModal: React.FC = ({ onClose, onJoin, data }) => { const [isJoiningLoading, setIsJoiningLoading] = useState(false); const handleJoin = () => { setIsJoiningLoading(true); onJoin() .then(() => { setIsJoiningLoading(false); handleClose(); }) .catch(() => { setIsJoiningLoading(false); }); }; const handleClose = () => { onClose(); }; return (
Join Project?

Are you sure you want to join{" "} {data?.name}?

); };