Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3475 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3475 Rev 3536
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { FormControl, InputAdornment, InputBase, InputLabel, Typography } from '@mui/material';
2
import { FormControl, InputAdornment, InputBase, InputLabel, Typography } from '@mui/material';
3
import { Controller, useFormContext } from 'react-hook-form';
3
import { Controller, useFormContext } from 'react-hook-form';
Línea 4... Línea 4...
4
 
4
 
5
export function FormInput({ icon, name, rules, label, disabled, ...props }) {
5
export function FormInput({ icon, name, rules, label, disabled, endAdornment, ...props }) {
Línea 6... Línea 6...
6
  const { control } = useFormContext();
6
  const { control } = useFormContext();
7
 
7
 
8
  return (
8
  return (
Línea 15... Línea 15...
15
        <FormControl variant='standard' fullWidth>
15
        <FormControl variant='standard' fullWidth>
16
          {label && <InputLabel shrink>{label}</InputLabel>}
16
          {label && <InputLabel shrink>{label}</InputLabel>}
17
          <InputBase
17
          <InputBase
18
            {...field}
18
            {...field}
19
            startAdornment={icon && <InputAdornment>{icon}</InputAdornment>}
19
            startAdornment={icon && <InputAdornment>{icon}</InputAdornment>}
-
 
20
            endAdornment={endAdornment && <InputAdornment>{endAdornment}</InputAdornment>}
20
            fullWidth
21
            fullWidth
21
            {...props}
22
            {...props}
22
          />
23
          />
23
          {error && (
24
          {error && (
24
            <Typography sx={{ color: 'red', fontSize: '0.75rem' }}>{error.message}</Typography>
25
            <Typography sx={{ color: 'red', fontSize: '0.75rem' }}>{error.message}</Typography>