import React from 'react'; import { Comment } from '../../stores/annotationStore'; import { getAuthorColor, getAuthorInitial } from '../../utils/authorColors'; import { relativeTime } from '../../utils/relativeTime'; import { TEXT_PRIMARY, TEXT_MUTED, BORDER } from './feedbackStyles'; interface CommentItemProps { comment: Comment; isOwn: boolean; onDelete?: () => void; } export default function CommentItem({ comment, isOwn, onDelete }: CommentItemProps) { return (
{getAuthorInitial(comment.author_name)} {comment.author_name} {relativeTime(comment.created_at)} {comment.edited_at && ( (edited) )}
{isOwn && onDelete && ( )}
{comment.content}
); }