Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3695 | | 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'
17
        rules={{ required: 'Por favor, califique la lección' }}
18
        defaultValue={2.5}
19
        style={{ marginBottom: 0 }}
20
      />
21
      <FormInput
22
        name='comment'
23
        placeholder={labels.write_a_comment}
24
        rules={{ required: 'Por favor, escriba un comentario' }}
25
        autoComplete='off'
26
        endAdornment={
27
          <IconButton type='submit' sx={{ padding: 0.4 }}>
28
            <SendRounded />
29
          </IconButton>
30
        }
31
      />
32
    </Form>
33
  );
34
}