use crate::{
    components::void_buttons::{ButtonGroup, NavigationButton},
    utils::user_prefs::{ThemedComponent, UserPrefs},
};
use dioxus::prelude::*;

pub fn Footer(props: UserPrefs) -> Element {
    rsx! {
        MutantStandardFooter { theme: props.clone().get_theme(), font: props.clone().get_font() }
    }
}

fn MutantStandardFooter(props: UserPrefs) -> Element {
    let user_prefs = UserPrefs::new(props.clone().get_theme(), props.clone().get_font());
    let user_theme = props.get_theme_classes(ThemedComponent::Card);
    let user_font = props.get_font_class();
    rsx! {
        div { class: "p-4 flex flex-col space-y-4 mx-auto max-w-full justify-center ring-4 {user_theme} {user_font}",
            ButtonGroup{
                NavigationButton { title: "⚙️ Settings".to_string(), slug: "/settings".to_string(), user_prefs: user_prefs.clone() }
                NavigationButton { title: " /src".to_string(), slug: "https://gitea.werefox.cafe/ada/void-werefox-cafe".to_string(), user_prefs: user_prefs, override_font: "font-nerd".to_string() }
            }
            div { class: "flex mx-auto max-w-full justify-center text-md text-center",
                "This site uses Mutant Standard emoji, which are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"
            }
        }
    }
}
