use crate::{components::*, icon::*, utils::mount_style::mount_style}; use leptos::*; use web_sys::MouseEvent; #[component] pub fn NavBar( #[prop(optional, into)] title: MaybeSignal<&'static str>, #[prop(optional, into)] left_arrow: MaybeSignal, #[prop(optional, into)] left_text: MaybeSignal<&'static str>, #[prop(optional, into)] click_left: Option>, #[prop(optional, into)] right_text: MaybeSignal<&'static str>, #[prop(optional, into)] click_right: Option>, ) -> impl IntoView { mount_style("nav-bar", include_str!("./nav-bar.css")); let onclick_left = move |ev| { if let Some(click_left) = click_left { click_left.set(ev); } }; let onclick_right = move |ev| { if let Some(click_right) = click_right { click_right.set(ev); } }; view! {
{left_text.get()}
{move || title.get()}
{right_text.get()}
} }