This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
qoverflow/client/src/components/QAComponents/AnswerComment.jsx
“spicecat” c7bf08de29 delete comment
2022-08-18 16:32:07 -04:00

33 lines
947 B
JavaScript

import DeleteIcon from '@mui/icons-material/Delete';
import { Divider, IconButton, ListItem, ListItemText } from '@mui/material';
import { CreationInfoTag } from 'controllers';
import { VoteControl } from 'controllers/QAControllers';
export default function AnswerComment({
comment_id,
creator,
createdAt,
downvotes,
text,
upvotes,
getVote,
onDelete,
updateVote,
}) {
return (
<span key={comment_id}>
<ListItem disablePadding>
<ListItemText>
<CreationInfoTag {...{ createdAt, creator, text: 'commented' }} />
{text}
</ListItemText>
<VoteControl {...{ downvotes, getVote, updateVote, upvotes }} />
{onDelete && <IconButton onClick={onDelete}>
<DeleteIcon />
</IconButton>}
</ListItem>
<Divider />
</span>
);
}