started using ratatui

This commit is contained in:
thatscringebro
2025-12-10 20:54:25 -05:00
parent 24ac0a0fbe
commit 55dfd16cd2
4 changed files with 282 additions and 137 deletions

29
src/app.rs Normal file
View File

@@ -0,0 +1,29 @@
use sqlite::Connection;
pub enum CurrentScreen {
Main,
Exiting,
}
pub struct App {
pub current_screen: CurrentScreen,
connection: Connection,
exit: bool,
}
impl App {
pub fn new() -> App {
let connection = match Connection::open("ft_rs.db") {
Ok(con) => con,
Err(e) => {
eprintln!("Error opening database: {}", e);
panic!("stopping");
}
};
return App {
current_screen: CurrentScreen::Main,
connection: connection,
exit: false,
};
}
}