Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3548 Rev 3549
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { FormControl, FormHelperText, FormLabel, Rating } from '@mui/material';
-
 
3
 
-
 
4
import { Controller, useFormContext } from 'react-hook-form';
2
import { Controller, useFormContext } from 'react-hook-form';
-
 
3
import { FormControl, FormHelperText, FormLabel, Rating } from '@mui/material';
Línea 5... Línea 4...
5
 
4
 
6
export function FormInputRating({ name = 'rating', label = '', rules = {}, readOnly = false }) {
5
export function FormInputRating({ name = 'rating', label = '', rules = {}, readOnly = false }) {
Línea 7... Línea 6...
7
  const { control } = useFormContext();
6
  const { control } = useFormContext();
8
 
7
 
9
  return (
8
  return (
10
    <Controller
9
    <Controller
11
      control={control}
10
      control={control}
12
      name={name}
11
      name={name}
13
      rules={rules}
12
      rules={rules}
14
      render={({ field, fieldState: { error } }) => (
13
      render={({ field, fieldState: { error } }) => (
15
        <FormControl error={!!error}>
14
        <FormControl error={!!error} variant='standard' fullWidth>
16
          {label && <FormLabel shrink>{label}</FormLabel>}
15
          {label && <FormLabel shrink>{label}</FormLabel>}
17
          <Rating
16
          <Rating
18
            onChange={field.onChange}
17
            onChange={field.onChange}