({
children,
pendingText,
className,
...props
}: FormButtonProps)
| 7 | } |
| 8 | |
| 9 | export function FormButton({ |
| 10 | children, |
| 11 | pendingText, |
| 12 | className, |
| 13 | ...props |
| 14 | }: FormButtonProps) { |
| 15 | const { isSubmitting } = useFormState(); |
| 16 | |
| 17 | return ( |
| 18 | <Button className={className} disabled={isSubmitting} {...props}> |
| 19 | {isSubmitting ? ( |
| 20 | <> |
| 21 | <Icons.refreshCw className="sp-mr-2 sp-h-4 sp-w-4 sp-animate-spin" /> |
| 22 | {pendingText || "Processing..."} |
| 23 | </> |
| 24 | ) : ( |
| 25 | <>{children}</> |
| 26 | )} |
| 27 | </Button> |
| 28 | ); |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected