--- import type Thread from '../models/Thread'; import Post from './Post.astro'; import Image from './Image.astro'; export interface Props { thread: Thread; board: string; comments: boolean; } const { thread, board, comments = false } = Astro.props; let replies: string[] = []; const listReplies = (id: string, getReplies: boolean = false): any => { if(getReplies) return replies; replies = []; thread.comments.forEach(comment => { if(comment.commentText.includes(id)) replies.push(comment.id); }) if(replies.length <= 0) return false; return true; } --- {(thread.id != "rules") && ( <> {comments && (listReplies(thread.id) && ( {listReplies(thread.id, true).map((id) => ( <> >>{id} ))}
))}

{thread.threadName}

{comments && ( <> {thread.comments.map((comment) => ( <> {listReplies(comment.id) && ( {listReplies(comment.id, true).map((id) => ( <> >>{id} ))}


)}

))} )} )} {comments && ( <> )}