@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::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()), {
@:card_title({ Comment }) @:card_body({

Update Comment

@:text_input(&view.input) }) @:card_body({ @:button_group(&[ &Button::primary("Update").dark(nav_state.dark()), &Button::secondary("Back to Submission").href(&view.submission_path()).dark(nav_state.dark()), ]) })
}) @if view.comments.has_children() { @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ Replies }) @:card_body({
@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! }) }