Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3536 | Rev 3548 | 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 { Box, IconButton } from '@mui/material';
import { SendRounded } from '@mui/icons-material';

import { Form, FormInput } from '../form';

export function CommentForm({ onSubmit = () => {} }) {
  const labels = useSelector(({ intl }) => intl.labels);

  return (
    <Form onSubmit={onSubmit}>
      <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
        <FormInput
          name='comment'
          placeholder={labels.write_a_comment}
          rules={{ required: 'Este campo es requerido' }}
          autoComplete='off'
          endAdornment={
            <IconButton type='submit' sx={{ padding: 0.4 }}>
              <SendRounded />
            </IconButton>
          }
        />
      </Box>
    </Form>
  );
}