Rev 1781 | Rev 1784 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'import {FormControl,InputLabel,MenuItem,Select as MuiSelect} from '@mui/material'import FormErrorFeedback from '../form/FormErrorFeedback'const Select = ({label = '',options = [],inputRef = null,name = '',value,onChange,error = null}) => {return (<FormControl fullWidth>{label ? (<InputLabel shrink htmlFor={name}>{label}</InputLabel>) : null}<MuiSelectref={inputRef}value={value}onChange={onChange}id={name}fullWidth>{options.map(({ name, value }) => (<MenuItem key={value} value={value}>{name}</MenuItem>))}</MuiSelect>{error ? <FormErrorFeedback>{error}</FormErrorFeedback> : null}</FormControl>)}export default Select