import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Avatar } from '@edx/paragon'; import { AvatarOutlineAndLabelColors } from '../../../../data/constants'; import { AuthorLabel } from '../../../common'; import { useAlertBannerVisible } from '../../../data/hooks'; const CommentHeader = ({ author, authorLabel, abuseFlagged, closed, createdAt, lastEdit, }) => { const colorClass = AvatarOutlineAndLabelColors[authorLabel]; const hasAnyAlert = useAlertBannerVisible({ author, abuseFlagged, lastEdit, closed, }); return (
); }; CommentHeader.propTypes = { author: PropTypes.string.isRequired, authorLabel: PropTypes.string, abuseFlagged: PropTypes.bool.isRequired, closed: PropTypes.bool, createdAt: PropTypes.string.isRequired, lastEdit: PropTypes.shape({ editorUsername: PropTypes.string, reason: PropTypes.string, }), }; CommentHeader.defaultProps = { authorLabel: null, closed: undefined, lastEdit: null, }; export default React.memo(CommentHeader);