Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/components/comment-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ export function CommentSection({ productId, mockComments }: Props) {

<div className="mt-4 space-y-4">
{comments.map((comment) => {
const author = comment.author as unknown as {
display_name: string;
handle: string | null;
avatar_url: string | null;
};
const author = comment.author;
return (
<div key={comment.id} className="rounded-xl border border-border bg-card-bg p-4">
<div className="flex items-center gap-2">
Expand Down
3 changes: 2 additions & 1 deletion src/types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface Product {
}

export type ProductBuilder = Pick<Profile, "display_name" | "handle" | "avatar_url">;
export type CommentAuthor = Pick<Profile, "display_name" | "handle" | "avatar_url">;

export interface ProductWithCounts extends Product {
vote_count: number;
Expand All @@ -57,7 +58,7 @@ export interface Comment {
body: string;
status: CommentStatus;
created_at: string;
author?: Pick<Profile, "display_name" | "handle" | "avatar_url">;
author?: CommentAuthor;
}

export interface DemoDay {
Expand Down