// types import { useForm } from "react-hook-form"; import useToast from "hooks/use-toast"; import workspaceService from "services/workspace.service"; import { ICurrentUserResponse, IUser } from "types"; // ui components import { MultiInput, PrimaryButton, SecondaryButton } from "components/ui"; type Props = { setStep: React.Dispatch>; workspace: any; user: ICurrentUserResponse | undefined; }; export const InviteMembers: React.FC = ({ setStep, workspace, user }) => { const { setToastAlert } = useToast(); const { setValue, watch, handleSubmit, formState: { isSubmitting }, } = useForm(); const onSubmit = async (formData: IUser) => { await workspaceService .inviteWorkspace(workspace.slug, formData, user) .then(() => { setToastAlert({ type: "success", title: "Invitations sent!", }); setStep(4); }) .catch((err) => console.log(err)); }; const checkEmail = watch("emails") && watch("emails").length > 0; return (
{ if (e.code === "Enter") e.preventDefault(); }} >

Invite co-workers to your team

Email
{isSubmitting ? "Inviting..." : "Continue"} setStep(4)} > Skip
); };