Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3452 Rev 3475
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, color, style, ...props }) {
5
export function FormInput({ icon, name, rules, label, disabled, ...props }) {
Línea 6... Línea 6...
6
  const { control } = useFormContext();
6
  const { control } = useFormContext();
7
 
7
 
8
  return (
8
  return (
9
    <Controller
9
    <Controller
10
      name={name}
10
      name={name}
11
      control={control}
11
      control={control}
12
      disabled={disabled}
12
      disabled={disabled}
13
      rules={rules}
13
      rules={rules}
14
      render={({ field, fieldState: { error } }) => (
14
      render={({ field, fieldState: { error } }) => (
15
        <FormControl variant='standard' fullWidth sx={style}>
15
        <FormControl variant='standard' fullWidth>
16
          {label && <InputLabel shrink>{label}</InputLabel>}
16
          {label && <InputLabel shrink>{label}</InputLabel>}
17
          <InputBase
-
 
18
            {...field}
17
          <InputBase
19
            color={color}
18
            {...field}
20
            startAdornment={icon && <InputAdornment>{icon}</InputAdornment>}
19
            startAdornment={icon && <InputAdornment>{icon}</InputAdornment>}
21
            fullWidth
20
            fullWidth
22
            {...props}
21
            {...props}