Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1781 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1459 stevensc 1
import React from 'react'
2
import { InputLabel, MenuItem, Select } from '@mui/material'
3
 
4
import InputBase from './InputBase'
5
 
6
const SelectInput = ({
7
  label = '',
8
  options = [],
9
  inputRef = null,
10
  id = '',
11
  ...rest
12
}) => {
13
  return (
14
    <>
15
      {label ? (
16
        <InputLabel shrink htmlFor={id}>
17
          {label}
18
        </InputLabel>
19
      ) : null}
20
 
21
      <Select ref={inputRef} input={<InputBase />} id={id} fullWidth {...rest}>
22
        {options.map(({ name, value }) => (
23
          <MenuItem key={value} value={value}>
24
            {name}
25
          </MenuItem>
26
        ))}
27
      </Select>
28
    </>
29
  )
30
}
31
 
32
export default SelectInput