Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3554 Rev 3555
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Controller, useFormContext } from 'react-hook-form';
2
import { Controller, useFormContext } from 'react-hook-form';
3
import { FormControl, FormHelperText, FormLabel, Rating } from '@mui/material';
3
import { FormControl, FormHelperText, FormLabel, Rating } from '@mui/material';
Línea 4... Línea 4...
4
 
4
 
-
 
5
export function FormInputRating({
-
 
6
  name = 'rating',
-
 
7
  label = '',
-
 
8
  rules = {},
-
 
9
  readOnly = false,
-
 
10
  size = 'large'
5
export function FormInputRating({ name = 'rating', label = '', rules = {}, readOnly = false }) {
11
}) {
Línea 6... Línea 12...
6
  const { control } = useFormContext();
12
  const { control } = useFormContext();
7
 
13
 
8
  return (
14
  return (
Línea 14... Línea 20...
14
        <FormControl error={!!error} variant='standard' fullWidth>
20
        <FormControl error={!!error} variant='standard' fullWidth>
15
          {label && <FormLabel shrink>{label}</FormLabel>}
21
          {label && <FormLabel shrink>{label}</FormLabel>}
16
          <Rating
22
          <Rating
17
            onChange={(_, value) => field.onChange(value)}
23
            onChange={(_, value) => field.onChange(value)}
18
            value={field.value}
24
            value={field.value}
19
            sx={{ fontSize: 20 }}
25
            sx={{ fontSize: size === 'large' ? 20 : 16 }}
20
            readOnly={readOnly}
26
            readOnly={readOnly}
-
 
27
            size={size}
21
          />
28
          />
22
          {error && <FormHelperText error={!!error}>{error.message}</FormHelperText>}
29
          {error && <FormHelperText error={!!error}>{error.message}</FormHelperText>}
23
        </FormControl>
30
        </FormControl>
24
      )}
31
      )}
25
    />
32
    />