Download frontend/src/components/CommentRow.tsx from devrup404/SignalMod: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/devrup404/SignalMod/resolve/c2dca5134d67b02cdcdc22bb21994f31996a1715/frontend/src/components/CommentRow.tsx
- Command line
-
hf download hf://spaces/devrup404/SignalMod@c2dca5134d67b02cdcdc22bb21994f31996a1715/frontend/src/components/CommentRow.tsx
-
curl -L -o CommentRow.tsx https://huggingface.co/spaces/devrup404/SignalMod/resolve/c2dca5134d67b02cdcdc22bb21994f31996a1715/frontend/src/components/CommentRow.tsx
1.25 kB
| 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 ( | |
| <div className={`comment-row ${comment.is_toxic ? "toxic" : "safe"}`}> | |
| <div className={`avatar ${comment.is_toxic ? "toxic" : ""}`}> | |
| {comment.user.charAt(0).toUpperCase()} | |
| </div> | |
| <div className="comment-body"> | |
| <div className="comment-meta"> | |
| <span className="comment-user">@{comment.user}</span> | |
| <span className="comment-time">{comment.time}</span> | |
| <span className={`badge ${comment.is_toxic ? "badge-toxic" : "badge-safe"}`}> | |
| {comment.is_toxic ? "Toxic" : "Safe"} | |
| </span> | |
| <span className="comment-pct" style={{ color }}> | |
| {formatPct(comment.probability)} | |
| </span> | |
| </div> | |
| <p className="comment-text">{comment.text}</p> | |
| {comment.is_toxic && <p className="flagged">Flagged for review</p>} | |
| {comment.labels.length > 0 && ( | |
| <p className="comment-labels">{comment.labels.join(" · ")}</p> | |
| )} | |
| </div> | |
| </div> | |
| ); | |
| } | |