import { formatPct, toxicityColor } from "../utils/toxicity"; import type { CommentItem } from "../types/api"; type Props = { comment: CommentItem }; export function CommentRow({ comment }: Props) { const color = toxicityColor(comment.probability); return (
{comment.user.charAt(0).toUpperCase()}
@{comment.user} {comment.time} {comment.is_toxic ? "Toxic" : "Safe"} {formatPct(comment.probability)}

{comment.text}

{comment.is_toxic &&

Flagged for review

} {comment.labels.length > 0 && (

{comment.labels.join(" ยท ")}

)}
); }