@use crate::ActixLoader; @use crate::extensions::ProfileExt; @use crate::nav::NavState; @use crate::profile_list::ProfileListState; @use crate::templates::layouts::wide; @use hyaenidae_toolkit::{templates::button_group, Button}; @use hyaenidae_toolkit::{templates::{card, card_body, card_section}, Card}; @use hyaenidae_toolkit::templates::centered; @use hyaenidae_toolkit::{templates::{icon, image}, Size}; @use hyaenidae_toolkit::{templates::link, Link}; @use hyaenidae_toolkit::templates::search; @use hyaenidae_toolkit::{templates::{tab, tab_group}, Tab}; @use i18n_embed_fl::fl; @(loader: &ActixLoader, state: &ProfileListState, nav_state: &NavState) @:wide(loader, &fl!(loader, "discover-users-title"), &fl!(loader, "discover-users-subtitle"), nav_state, {}, {
@:tab_group({ @:tab(Tab::new("/browse"), { @fl!(loader, "submissions-tab") }) @:tab(Tab::new("/discover").selected(true), { @fl!(loader, "profiles-tab") }) })
@:centered(false, { @:card(&Card::full_width().dark(nav_state.dark()), { @for pview in state.profiles() { @:card_section({
@if let Some(img) = pview.banner_image(loader) {
@:image(&img)
}
@:icon(&pview.icon(loader).size(Size::Small).dark(nav_state.dark()))
@if let Some(display_name) = pview.profile.display_name() { @:link(&Link::current_tab(&pview.profile.view_path()).plain(true), { @Html(display_name) }) }
@:link(&Link::current_tab(&pview.profile.view_path()).plain(true), { @pview.profile.full_handle() })
@if !pview.profile.is_suspended() { @:button_group(&state.profile_buttons(loader, pview)) }
}) } @if state.has_nav() { @:card_body({ @:button_group(&state.nav(loader)) }) } }) }) })