1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-09 01:17:06 +02:00
unleash.unleash/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestComments/AddCommentField.tsx

34 lines
1007 B
TypeScript

import { FC } from 'react';
import { Box, Button, styled, TextField } from '@mui/material';
import { StyledAvatar } from './StyledAvatar';
const AddCommentWrapper = styled(Box)(({ theme }) => ({
display: 'flex',
marginTop: theme.spacing(2),
marginBottom: theme.spacing(1),
}));
export const AddCommentField: FC<{
imageUrl: string;
commentText: string;
onTypeComment: (text: string) => void;
}> = ({ imageUrl, commentText, onTypeComment, children }) => (
<>
<AddCommentWrapper>
<StyledAvatar src={imageUrl} />
<TextField
variant="outlined"
placeholder="Add your comment here"
fullWidth
multiline
minRows={2}
onChange={e => onTypeComment(e.target.value)}
value={commentText}
/>
</AddCommentWrapper>
<Box sx={{ display: 'flex', justifyContent: 'flex-end' }}>
{children}
</Box>
</>
);