diff --git a/quotesdb/src/bin/ui/pages/author.rs b/quotesdb/src/bin/ui/pages/author.rs index 4300f32..9b1500a 100644 --- a/quotesdb/src/bin/ui/pages/author.rs +++ b/quotesdb/src/bin/ui/pages/author.rs @@ -1,15 +1,116 @@ //! Author page — all quotes by a specific author. + +use crate::api; +use crate::components::error::ErrorDisplay; +use crate::components::pagination::Pagination; +use crate::components::quote_card::QuoteCard; +use quotesdb::Quote; +use wasm_bindgen_futures::spawn_local; +use web_sys::HtmlInputElement; use yew::prelude::*; /// Props for the [`AuthorPage`] component. #[derive(Properties, PartialEq)] pub struct AuthorPageProps { - /// The author name from the route parameter. + /// The author name from the route parameter (URL-decoded by yew-router). pub name: String, } -/// Author page component. Lists all quotes attributed to the given author. +/// Author page component. +/// +/// Lists all quotes attributed to the given author, with pagination support. +/// Also provides a tag filter to narrow results within the author's quotes. #[function_component(AuthorPage)] pub fn author_page(props: &AuthorPageProps) -> Html { - html! {
{ format!("Loading quotes by {}...", props.name) }
} + let name = props.name.clone(); + let page = use_state(|| 1u32); + let total_pages = use_state(|| 1u32); + let tag_filter = use_state(String::new); + let quotes: UseStateHandle