diff --git a/packages/cyberstorm-forms/src/components/FormSubmitButton.tsx b/packages/cyberstorm-forms/src/components/FormSubmitButton.tsx index 3d4216b44..16ac459e0 100644 --- a/packages/cyberstorm-forms/src/components/FormSubmitButton.tsx +++ b/packages/cyberstorm-forms/src/components/FormSubmitButton.tsx @@ -7,21 +7,23 @@ import { faArrowsRotate } from "@fortawesome/free-solid-svg-icons"; import { useFormState } from "react-hook-form"; import styles from "./FormSubmitButton.module.css"; -const SubmitButtonContent = React.memo((props: { isSubmitting: boolean }) => { - if (props.isSubmitting) { - return ( - - - - ); - } else { - return Create; +const SubmitButtonContent = React.memo( + (props: { isSubmitting: boolean; text: string }) => { + if (props.isSubmitting) { + return ( + + + + ); + } else { + return {props.text}; + } } -}); +); SubmitButtonContent.displayName = "SubmitButtonContent"; -export function FormSubmitButton() { +export function FormSubmitButton({ text }: { text: string }) { const { isSubmitting, disabled } = useFormState(); return ( @@ -31,7 +33,7 @@ export function FormSubmitButton() { colorScheme="success" disabled={isSubmitting || disabled} > - + ); } diff --git a/packages/cyberstorm-forms/src/forms/CreateTeamForm.tsx b/packages/cyberstorm-forms/src/forms/CreateTeamForm.tsx index 6dd3f01fd..2e3b01a02 100644 --- a/packages/cyberstorm-forms/src/forms/CreateTeamForm.tsx +++ b/packages/cyberstorm-forms/src/forms/CreateTeamForm.tsx @@ -38,7 +38,7 @@ export function CreateTeamForm() {
- +
);