Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3736
Línea 6... Línea 6...
6
 
6
 
7
export function FormFilePicker({
7
export function FormFilePicker({
8
  label = '',
8
  label = '',
9
  name = 'file',
9
  name = 'file',
10
  type = 'image',
-
 
11
  multiple = false,
-
 
12
  maxFiles = 1,
10
  type = 'image',
-
 
11
  description = 'Arrastra el archivo aqui, o haga click para seleccionar',
13
  description = 'Arrastra el archivo aqui, o haga click para seleccionar',
12
  multiple = false,
14
  rules = {}
13
  rules = {}
15
}) {
14
}) {
Línea 16... Línea 15...
16
  const { control } = useFormContext();
15
  const { control } = useFormContext();
Línea 24... Línea 23...
24
        <FormControl variant='standard' fullWidth>
23
        <FormControl variant='standard' fullWidth>
25
          {label && <InputLabel shrink>{label}</InputLabel>}
24
          {label && <InputLabel shrink>{label}</InputLabel>}
Línea 26... Línea 25...
26
 
25
 
27
          <FilePicker
26
          <FilePicker
28
            type={type}
-
 
29
            multiple={multiple}
-
 
30
            maxFiles={maxFiles}
27
            type={type}
31
            description={description}
28
            description={description}
32
            defaultFiles={multiple ? value : [value]}
29
            defaultFiles={value}
-
 
30
            onChange={(files) => {
-
 
31
              if (multiple) {
-
 
32
                onChange(files);
-
 
33
              } else {
-
 
34
                onChange(files[0]);
-
 
35
              }
33
            onChange={onChange}
36
            }}
34
          />
37
          />
35
        </FormControl>
38
        </FormControl>
36
      )}
39
      )}
37
    />
40
    />