use andiskaz::{
emergency_restore,
error::Error,
terminal::Terminal,
tstring,
ui::info::InfoDialog,
};
use std::{panic, process::exit};
#[tokio::main]
async fn main() {
panic::set_hook(Box::new(|info| {
let _ = emergency_restore();
eprintln!("{}", info);
}));
let result = Terminal::run(term_main).await;
if let Ok(Err(error)) | Err(error) = result {
eprintln!("{}", error);
exit(-1);
}
}
async fn term_main(mut term: Terminal) -> Result<(), Error> {
InfoDialog::new(tstring!["Hello"], tstring!["This is a hello message"])
.run(&mut term)
.await?;
Ok(())
}