aboutsummaryrefslogtreecommitdiff
path: root/src/components/hello_world.rs
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-03-06 01:11:00 -0500
committerShav Kinderlehrer <[email protected]>2024-03-06 01:11:00 -0500
commit557d3f32fd2ac7a21bd3da01e8e903db16a31e7e (patch)
treed4fdec837619601919a908218a943d75dc293a58 /src/components/hello_world.rs
parent022574877dbabc1fbb386dc3b59765de528107c9 (diff)
downloadmolehole-557d3f32fd2ac7a21bd3da01e8e903db16a31e7e.tar.gz
molehole-557d3f32fd2ac7a21bd3da01e8e903db16a31e7e.zip
Implement app components
Diffstat (limited to 'src/components/hello_world.rs')
-rw-r--r--src/components/hello_world.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/hello_world.rs b/src/components/hello_world.rs
new file mode 100644
index 0000000..22c966c
--- /dev/null
+++ b/src/components/hello_world.rs
@@ -0,0 +1,17 @@
+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(())
+ }
+}