import React, { useState } from "react"; import { X } from "@phosphor-icons/react"; import Admin from "@/models/admin"; import { useTranslation } from "react-i18next"; export default function NewWorkspaceModal({ closeModal }) { const [error, setError] = useState(null); const { t } = useTranslation(); const handleCreate = async (e) => { setError(null); e.preventDefault(); const form = new FormData(e.target); const { workspace, error } = await Admin.newWorkspace(form.get("name")); if (!!workspace) window.location.reload(); setError(error); }; return (

Create new workspace

{error &&

Error: {error}

}

After creating this workspace only admins will be able to see it. You can add users after it has been created.

); }