use crate::{components::*, icon::*, utils::mount_style::mount_style}; use leptos::*; #[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 on_click_left = move |ev| { if let Some(click_left) = click_left.as_ref() { click_left.call(ev); } }; let on_click_right = move |ev| { if let Some(click_right) = click_right.as_ref() { click_right.call(ev); } }; view! {
{move || left_text.get()}
{move || title.get()}
{move || right_text.get()}
} }