import React from 'react'; import { useFormContext } from './context'; import Button from '@/components/elements/Button'; type Props = Omit, 'type'>; /** Disabled while the form cannot submit; shows a spinner while it submits. */ export function SubmitButton({ children, disabled, ...props }: Props) { const form = useFormContext(); return ( ({ canSubmit: state.canSubmit, isSubmitting: state.isSubmitting })}> {({ canSubmit, isSubmitting }) => ( )} ); }