import { useTranslation } from "../utils/i18n";
import { useNavigate } from "react-router";
import { Comment } from "../network/models";
import { network } from "../network/network";
import Badge from "./badge";
import Markdown from "react-markdown";
export function CommentTile({
comment,
elevation,
}: {
comment: Comment;
onUpdated?: () => void;
elevation?: "normal" | "high";
}) {
const navigate = useNavigate();
const { t } = useTranslation();
const link = `/comments/${comment.id}`;
const userLink = `/user/${encodeURIComponent(comment.user.username)}`;
// @ts-ignore
return (
{
e.preventDefault();
navigate(link);
}}
>
{
e.stopPropagation();
e.preventDefault();
navigate(userLink);
}}
>
{comment.user.username}
{e.user.username}: {CommentToPlainText(e.content)}
); })} {comment.reply_count > comment.replies.length ? ({t("View {count} more replies").replace( "{count}", (comment.reply_count - comment.replies.length).toString(), )}
) : null}