// Code generated by moon-templ. DO NOT EDIT.
///|
pub fn page(title : String, posts : Array[Post]) -> @rt.Component {
@rt.component(fn(ctx, w) {
let ctx = ctx.clear_children()
layout(title).with_children(@rt.component(fn(ctx, w) {
w.write_string("")
for post in posts {
w.write_string("- ")
if post.published {
@ui.card(post.title, post.body).render(ctx, w)
} else {
w.write_string("")
@rt.write_any(w, post.title)
w.write_string("")
}
w.write_string("
")
}
w.write_string("
")
})).render(ctx, w)
})
}