import React, { useContext } from "react" import BoxFull from "../base/BoxFull" import FormLabelled from "../base/FormLabelled" import FormLabel from "../base/formparts/FormLabel" import InputWithIcon from "../base/InputWithIcon" import { faBackward, faFolder, faPencilAlt, faPlus } from "@fortawesome/free-solid-svg-icons" import Radio from "../base/Radio" import Button from "../base/Button" import useRepositoryEditor from "../../hooks/useRepositoryEditor" import FormAlert from "../base/formparts/FormAlert" import goToOnSuccess from "../../utils/goToOnSuccess" import { useHistory } from "react-router" import ContextLanguage from "../../contexts/ContextLanguage" /** * A {@link BoxFull} allowing the user to save the changes made in the current {@link RepositoryEditor}. * * @param running - If a request is running, disabling the buttons. * @param props - Additional props to pass to the box. * @returns {JSX.Element} * @constructor */ export default function BoxRepositoryCreate({ running, ...props }) { const { id, evaluationMode, setEvaluationMode, name, setName, save, revert, error, } = useRepositoryEditor() const history = useHistory() const { strings } = useContext(ContextLanguage) return ( { e.preventDefault() save() }} > setName(e.target.value)} />   {error ? {strings[error.data.code]} : null} {id ? <> : } ) }