summaryrefslogtreecommitdiff
path: root/src/render/tasks.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2024-05-22 22:54:50 +0200
committerJulian T <julian@jtle.dk>2024-05-22 22:54:50 +0200
commitdd11cf4ab199e5d53d03dc95b24007a12727ad70 (patch)
tree710f94ac775ac8e3d279f40638034b847516f0e3 /src/render/tasks.rs
parent829cbaf2d0fe95abc9c65b1e34e209fc32952805 (diff)
Start goprojekt istedet
Diffstat (limited to 'src/render/tasks.rs')
-rw-r--r--src/render/tasks.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/render/tasks.rs b/src/render/tasks.rs
deleted file mode 100644
index 0f6a79a..0000000
--- a/src/render/tasks.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-use ratatui::{layout::Constraint, widgets::{Row, Table, Widget}, prelude::Text};
-
-use crate::model::Task;
-
-
-
-#[derive(Debug)]
-pub struct TaskList<'a> {
- tasks: &'a[Task]
-}
-
-impl<'a> TaskList<'a> {
- pub fn new(tasks: &'a[Task]) -> TaskList<'a> {
- TaskList {
- tasks
- }
- }
-}
-
-impl<'a> Widget for &TaskList<'a> {
- fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) {
- let rows: Vec<Row> = self.tasks.into_iter()
- .map(|t: &Task| Row::new(vec![Text::from(t.name.as_str()), Text::from(t.description.as_str())]))
- .collect();
-
- let widths = [
- Constraint::Percentage(50),
- Constraint::Fill(1),
- ];
-
- Table::new(rows, widths)
- .render(area, buf);
- }
-}