use crate::info_app::Route;
use dioxus::prelude::*;
use dioxus_router::prelude::*;

#[component]
pub fn BackButton(back_to: Route) -> Element {
    rsx! {
        nav {
            div {
                Link {
                    to: back_to,
                    class: "p-2 w-full inline-block text-lg text-center rounded-sm ring-2 bg-alice-werefox-grey-lightest dark:bg-alice-werefox-grey-dark ring-alice-werefox-red-dark dark:ring-alice-werefox-red hover:ring-alice-werefox-blue-dark dark:hover:ring-alice-werefox-blue text-alice-werefox-red-dark dark:text-alice-werefox-red-light hover:text-alice-werefox-blue-dark dark:hover:text-alice-werefox-blue-light focus:text-alice-werefox-blue-dark dark:focus:text-alice-werefox-blue-light hover:animate-yip transition",
                    span { class: "animate-jiggle sm:w-6 sm:h-6 w-4 h-6 inline-block align-top",
                        img { src: "/emoji/:aliceheartblack:.png", alt: "An emoji of Alice chomping a black heart." }
                    }
                    " Take me back!"
                }
            }
        }
    }
}
