use std::default::Default;
use std::any::Any;
use std::path::Path;
use eframe::epaint::Direction;
use egui::{Ui, Widget, WidgetText};
use egui_commonmark::{CommonMarkCache, CommonMarkViewer};
use egui_tiles::TileId;
use emulator_core::config::{VERSION};
use crate::ui::debugger::Action;
use crate::ui::debugger::panels::TilePane;

pub struct AboutScreen;

impl TilePane for AboutScreen {
    fn title(&self) -> WidgetText {
        "About DSA".into()
    }

    fn ui(&mut self, ui: &mut Ui, _tile_id: TileId) -> Option<Action> {

        ui.with_layout(
            egui::Layout::centered_and_justified(Direction::TopDown)
                .with_main_align(egui::Align::Center),
            |ui| {

                // title
                ui.heading(format!("Damn Simple Architecture v{} 🚀", VERSION));
            },
        );

        None
    }

    fn as_any_mut(&mut self) -> &mut dyn Any {
        self
    }
}