// 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((res) => { console.log(res); setToastAlert({ type: "success", title: "Invitations sent!", }); setStep(4); }) .catch((err) => { console.log(err); }); }; return (
{ if (e.code === "Enter") e.preventDefault(); }} >

Invite co-workers to your team

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