Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3736
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Button } from '@mui/material';
2
import { Button } from '@mui/material';
3
import { useFormContext } from 'react-hook-form';
3
import { useFormContext } from 'react-hook-form';
Línea 4... Línea 4...
4
 
4
 
-
 
5
export const FormButton = ({ type = 'submit', children, ...props }) => {
-
 
6
  const {
5
export const FormButton = ({ type = 'submit', children, ...props }) => {
7
    formState: { isSubmitting, isValid, isLoading }
Línea 6... Línea 8...
6
  const { isSubmitting } = useFormContext();
8
  } = useFormContext();
-
 
9
 
-
 
10
  return (
-
 
11
    <Button
7
 
12
      type={type}
-
 
13
      {...props}
-
 
14
      disabled={isSubmitting || !isValid || isLoading}
-
 
15
      variant='contained'
8
  return (
16
      color='primary'
9
    <Button type={type} {...props} disabled={isSubmitting} variant='contained' color='primary'>
17
    >
10
      {children}
18
      {children}
11
    </Button>
19
    </Button>