'use client'; import { commentsTable, usersTable } from '@/lib/db/schema'; import { Reply } from 'lucide-react'; import styles from '@/styles/components/Comment.module.scss'; import CommentForm from './CommentForm'; import { useState } from 'react'; export type CommentWithReplies = typeof commentsTable.$inferSelect & { user: typeof usersTable.$inferSelect | null; replies: CommentWithReplies[]; }; export default function Comment({ comment, author, isRoot = false }: { comment: CommentWithReplies; author: bigint; isRoot?: boolean; }) { const displayName = comment.displayName ?? comment.user?.displayName ?? comment.user?.username ?? 'Unknown User'; const [open, setOpen] = useState(false); return (
{comment.content}