Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1781 | Autoría | Ultima modificación | Ver Log |

import React from 'react'
import { InputAdornment, TextField } from '@mui/material'

const Input = ({
  label = '',
  inputRef = null,
  icon: Icon = null,
  error = null,
  name = '',
  onChange = () => {},
  value = '',
  type = 'text',
  accept = ''
}) => {
  return (
    <TextField
      label={label}
      helperText={error}
      error={Boolean(error)}
      ref={inputRef}
      id={name}
      name={name}
      fullWidth
      onChange={onChange}
      value={value}
      InputProps={{
        startAdornment: Icon ? (
          <InputAdornment position='start'>
            <Icon />
          </InputAdornment>
        ) : null
      }}
      inputProps={{
        accept
      }}
      type={type}
    />
  )
}

export default Input