Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 stevensc 1
import React from 'react';
2
import { useSelector } from 'react-redux';
3
import { IconButton } from '@mui/material';
4
import SendRounded from '@mui/icons-material/SendRounded';
5
 
6
import { Form, FormInput } from '@shared/components';
7
import { FormInputRating } from '.';
8
 
9
export function CapsuleCommentForm({ onSubmit = () => {} }) {
10
  const labels = useSelector(({ intl }) => intl.labels);
11
 
12
  return (
13
    <Form onSubmit={onSubmit} defaultValues={{ comment: '', rating: 0 }} reset>
14
      <FormInputRating
15
        label='Calificación'
16
        name='rating'
3741 stevensc 17
        rules={{
18
          required: 'Por favor, califique la lección',
19
          min: { value: 1, message: 'Por favor, califique la lección' }
20
        }}
3719 stevensc 21
        defaultValue={2.5}
22
        style={{ marginBottom: 0 }}
23
      />
24
      <FormInput
25
        name='comment'
26
        placeholder={labels.write_a_comment}
27
        rules={{ required: 'Por favor, escriba un comentario' }}
28
        autoComplete='off'
29
        endAdornment={
30
          <IconButton type='submit' sx={{ padding: 0.4 }}>
31
            <SendRounded />
32
          </IconButton>
33
        }
34
      />
35
    </Form>
36
  );
37
}