Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1784 Rev 1785
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
-
 
2
import {
-
 
3
  FormControl,
-
 
4
  InputLabel,
-
 
5
  MenuItem,
-
 
6
  Select as MuiSelect
2
import { FormControl, InputLabel, Select as MuiSelect } from '@mui/material'
7
} from '@mui/material'
Línea 3... Línea 8...
3
 
8
 
Línea 4... Línea 9...
4
import FormErrorFeedback from '../form/FormErrorFeedback'
9
import FormErrorFeedback from '../form/FormErrorFeedback'
5
 
10
 
Línea 12... Línea 17...
12
  onChange = () => {},
17
  onChange = () => {},
13
  error = null
18
  error = null
14
}) => {
19
}) => {
15
  return (
20
  return (
16
    <FormControl fullWidth>
21
    <FormControl fullWidth>
-
 
22
      {label ? (
17
      {label ? <InputLabel htmlFor={name}>{label}</InputLabel> : null}
23
        <InputLabel shrink htmlFor={name}>
-
 
24
          {label}
-
 
25
        </InputLabel>
-
 
26
      ) : null}
18
      <MuiSelect
27
      <MuiSelect
19
        ref={inputRef}
28
        ref={inputRef}
20
        value={value}
29
        value={value}
21
        onChange={onChange}
30
        onChange={onChange}
-
 
31
        name={name}
22
        id={name}
32
        id={name}
23
        fullWidth
33
        fullWidth
24
      >
34
      >
25
        {options.map(({ name, value }) => (
35
        {options.map(({ name, value }) => (
26
          <option key={value} value={value}>
36
          <MenuItem key={value} value={value}>
27
            {name}
37
            {name}
28
          </option>
38
          </MenuItem>
29
        ))}
39
        ))}
30
      </MuiSelect>
40
      </MuiSelect>
31
      {error ? <FormErrorFeedback>{error}</FormErrorFeedback> : null}
41
      {error ? <FormErrorFeedback>{error}</FormErrorFeedback> : null}
32
    </FormControl>
42
    </FormControl>
33
  )
43
  )