// types import { useForm } from "react-hook-form"; import useToast from "hooks/use-toast"; import workspaceService from "services/workspace.service"; import { IUser } from "types"; // ui components import { MultiInput, PrimaryButton, SecondaryButton } from "components/ui"; type Props = { setStep: React.Dispatch>; workspace: any; }; export const InviteMembers: React.FC = ({ setStep, workspace }) => { const { setToastAlert } = useToast(); const { setValue, watch, handleSubmit, formState: { isSubmitting }, } = useForm(); const onSubmit = async (formData: IUser) => { await workspaceService .inviteWorkspace(workspace.slug, formData) .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 your team to your workspace.

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