Rev 1838 | AutorÃa | Ultima modificación | Ver Log |
import React from 'react'
import { InputAdornment, TextField } from '@mui/material'
const Input = ({
label,
inputRef,
name,
value,
placeholder,
accept,
error = null,
onChange = () => {},
type = 'text',
icon: Icon = null
}) => {
return (
<TextField
label={label}
helperText={error}
error={Boolean(error)}
ref={inputRef}
id={name}
name={name}
fullWidth
placeholder={placeholder}
onChange={onChange}
value={value}
InputProps={{
startAdornment: Icon ? (
<InputAdornment position='start'>
<Icon />
</InputAdornment>
) : null
}}
inputProps={{
accept
}}
type={type}
/>
)
}
export default Input