use leptos::*;
use leptos_router::*;

#[component]
pub fn Nav() -> impl IntoView {
    let (mobile_menu, set_mobile_menu) = create_signal(false);

    view! {
        <nav>
            <A href="/" class="nav-home">Florian RICHER</A>

            <span class="nav-mobile" on:click=move |_| set_mobile_menu(!mobile_menu())><leptos_icons::Icon icon=icondata::FiMenu/></span>
            <div class="nav-links" class:open=move || mobile_menu()>
                <A href="/experience" class="nav-link">Mon parcours</A>
                <A href="/posts" class="nav-link">Blog</A>
            </div>
        </nav>
    }
}