use leptos::prelude::*; use leptos_router::hooks::use_navigate; /// # Banner Component /// /// This component displays a red banner at the top of the page with a title and a logo. /// Clicking the logo will redirect a user to specified page, preferably a home page. /// /// Example usage: /// ``` /// /// ``` #[component] pub fn Banner( /// The title of the banner. #[prop(into)] title: String, /// The file path or URL of a logo displayed at the top left of the banner. #[prop(into)] logo: String, /// The route that the navigates user to a page (home page). #[prop(into, default = String::from("/"))] path: String, ) -> impl IntoView { let navigate = use_navigate(); let on_click = move |_| navigate(&path, Default::default()); view! {
icon

{title.clone()}

} }