molehole/src/components/hello_world.rs

18 lines
372 B
Rust
Raw Normal View History

2024-03-06 06:11:00 +00:00
use ratatui::prelude::*;
use ratatui::widgets::Paragraph;
use crate::component::Component;
#[derive(Default, Clone)]
pub struct HelloWorld {
pub text: String,
}
impl Component for HelloWorld {
fn render(&mut self, frame: &mut Frame, rect: Rect) -> eyre::Result<()> {
frame.render_widget(Paragraph::new(self.text.clone()), rect);
Ok(())
}
}