@use crate::templates::layouts::home; @use crate::templates::comments::nodes; @use crate::comments::CommentView; @use crate::nav::NavState; @use hyaenidae_toolkit::{templates::button_group, Button}; @use hyaenidae_toolkit::{templates::{card, card_title, card_body}, Card}; @use hyaenidae_toolkit::templates::nested; @use hyaenidae_toolkit::{templates::text_input}; @(view: &CommentView, nav_state: &NavState) @if let Some((comment, author)) = view.comments.item.comment() { @:home(&author.name(), comment.body(), nav_state, {}, { @:card(&Card::full_width().dark(nav_state.dark()), {
}) @if view.comments.has_children() { @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ Replies }) @:card_body({ @:nested(nav_state.dark(), { @for child in &view.comments.children { @:nodes(child, &view.comments.item, view.logged_in, nav_state.dark()) } }) }) }) } }) } else { @:home("Comment Gone", "Not sure where that comment went!", nav_state, {}, { Not sure where that comment went! }) }