use bevy::prelude::*;

use crate::menus::lib::OnPressAction;

use super::Action;

pub fn text(t: String) -> impl Bundle {
    (
        Text::new(t),
        TextFont {
            // font: asset_server.load("fonts/FiraSans-Bold.ttf"),
            font_size: 33.0,
            ..default()
        },
        TextColor(Color::srgb(0.9, 0.9, 0.9)),
        TextShadow::default(),
    )
}

pub fn button(t: String) -> impl Bundle {
    (
        Button,
        Node {
            border: UiRect::all(Val::Px(5.0)),
            // horizontally center child text
            justify_content: JustifyContent::Center,
            // vertically center child text
            align_items: AlignItems::Center,
            padding: UiRect::all(Val::Px(10.0)),
            ..default()
        },
        BorderColor(Color::BLACK),
        BorderRadius::MAX,
        BackgroundColor(Color::srgb(0.2, 0.2, 0.2)),
        children![text(t)],
    )
}
