Rev 3694 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react';
import { useSelector } from 'react-redux';
import { IconButton } from '@mui/material';
import SendRounded from '@mui/icons-material/SendRounded';
import { Form, FormInput } from '@shared/components';
import { FormInputRating } from '.';
export function CapsuleCommentForm({ onSubmit = () => {} }) {
const labels = useSelector(({ intl }) => intl.labels);
return (
<Form onSubmit={onSubmit} defaultValues={{ comment: '', rating: 0 }} reset>
<FormInputRating
label='Calificación'
name='rating'
rules={{ required: 'Por favor, califique la lección' }}
defaultValue={2.5}
style={{ marginBottom: 0 }}
/>
<FormInput
name='comment'
placeholder={labels.write_a_comment}
rules={{ required: 'Por favor, escriba un comentario' }}
autoComplete='off'
endAdornment={
<IconButton type='submit' sx={{ padding: 0.4 }}>
<SendRounded />
</IconButton>
}
/>
</Form>
);
}