chore: formatting cleanup

This commit is contained in:
CREDO23 2026-01-16 11:36:17 +02:00
parent 8de448a8ce
commit 09317cd9f7
13 changed files with 36 additions and 63 deletions

View file

@ -10,12 +10,7 @@ import {
} from "@/components/ui/dropdown-menu";
import type { CommentActionsProps } from "./types";
export function CommentActions({
canEdit,
canDelete,
onEdit,
onDelete,
}: CommentActionsProps) {
export function CommentActions({ canEdit, canDelete, onEdit, onDelete }: CommentActionsProps) {
if (!canEdit && !canDelete) {
return null;
}
@ -48,4 +43,3 @@ export function CommentActions({
</DropdownMenu>
);
}

View file

@ -56,11 +56,13 @@ function formatTimestamp(dateString: string): string {
return `${dayName} at ${timeStr}`;
}
return date.toLocaleDateString("en-US", {
month: "short",
day: "numeric",
year: date.getFullYear() !== now.getFullYear() ? "numeric" : undefined,
}) + ` at ${timeStr}`;
return (
date.toLocaleDateString("en-US", {
month: "short",
day: "numeric",
year: date.getFullYear() !== now.getFullYear() ? "numeric" : undefined,
}) + ` at ${timeStr}`
);
}
function renderMentions(content: string): React.ReactNode {
@ -75,10 +77,7 @@ function renderMentions(content: string): React.ReactNode {
}
parts.push(
<span
key={match.index}
className="rounded bg-primary/10 px-1 font-medium text-primary"
>
<span key={match.index} className="rounded bg-primary/10 px-1 font-medium text-primary">
{match[0]}
</span>
);
@ -100,11 +99,12 @@ export function CommentItem({
onReply,
isReply = false,
}: CommentItemProps) {
const displayName = comment.author?.displayName || comment.author?.email.split("@")[0] || "Unknown";
const displayName =
comment.author?.displayName || comment.author?.email.split("@")[0] || "Unknown";
const email = comment.author?.email || "";
return (
<div className={cn("group flex gap-3", isReply && "ml-10")}>
<div className={cn("group flex gap-3")}>
<Avatar className="size-8 shrink-0">
{comment.author?.avatarUrl && (
<AvatarImage src={comment.author.avatarUrl} alt={displayName} />
@ -152,4 +152,3 @@ export function CommentItem({
</div>
);
}

View file

@ -31,4 +31,3 @@ export interface CommentActionsProps {
onEdit: () => void;
onDelete: () => void;
}