Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3695 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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