Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1459 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1459 Rev 1781
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { InputAdornment, InputLabel } from '@mui/material'
2
import { InputAdornment, TextField } from '@mui/material'
Línea 3... Línea -...
3
 
-
 
4
import InputBase from './InputBase'
-
 
5
 
3
 
6
const TextInput = ({
4
const Input = ({
7
  label = '',
5
  label = '',
8
  inputRef = null,
6
  inputRef = null,
-
 
7
  icon: Icon = null,
-
 
8
  error = null,
-
 
9
  name = '',
9
  icon: Icon = null,
10
  onChange = () => {},
-
 
11
  value = '',
-
 
12
  type = 'text',
10
  ...rest
13
  accept = ''
11
}) => {
14
}) => {
12
  return (
15
  return (
13
    <>
16
    <TextField
14
      {label ? (
17
      label={label}
15
        <InputLabel shrink htmlFor={name}>
18
      helperText={error}
16
          {label}
19
      error={Boolean(error)}
17
        </InputLabel>
20
      ref={inputRef}
18
      ) : null}
-
 
19
 
21
      id={name}
-
 
22
      name={name}
-
 
23
      fullWidth
20
      <InputBase
24
      onChange={onChange}
21
        ref={inputRef}
25
      value={value}
22
        startAdornment={
26
      InputProps={{
23
          Icon ? (
27
        startAdornment: Icon ? (
24
            <InputAdornment position='start'>
28
          <InputAdornment position='start'>
25
              <Icon />
29
            <Icon />
26
            </InputAdornment>
30
          </InputAdornment>
27
          ) : null
31
        ) : null,
28
        }
32
        accept
29
        fullWidth
33
      }}
30
        {...rest}
-
 
31
      />
34
      type={type}
32
    </>
35
    />
33
  )
36
  )
Línea 34... Línea 37...
34
}
37
}