summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/table.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-02-08 20:26:30 +0000
committerJoe Carstairs <me@joeac.net>2026-02-08 20:26:30 +0000
commit97b413aa5962bded37dedb380034fa7b97bdc06c (patch)
tree2cb96478c3808e027528a175e673f77dcc328f9d /schist_desktop_gui/src/gui/components/table.rs
parent170c1a58ebd8b6ff1dceb5f46146f76b601c91ad (diff)
task-085: display transaction data in tables
Diffstat (limited to 'schist_desktop_gui/src/gui/components/table.rs')
-rw-r--r--schist_desktop_gui/src/gui/components/table.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/table.rs b/schist_desktop_gui/src/gui/components/table.rs
new file mode 100644
index 0000000..4c6d810
--- /dev/null
+++ b/schist_desktop_gui/src/gui/components/table.rs
@@ -0,0 +1,42 @@
+use std::collections::HashMap;
+
+mod view_table;
+
+#[derive(Clone, Debug, Default)]
+pub struct Table<Ix>
+where
+ Ix: Clone + std::fmt::Debug,
+{
+ pub cols: Vec<Column<Ix>>,
+ pub rows: Vec<HashMap<Ix, Value>>,
+}
+
+#[derive(Clone, Debug)]
+pub enum Value {
+ String(String),
+ Currency(i32),
+}
+
+#[derive(Clone, Debug)]
+pub struct Column<Ix>
+where
+ Ix: Clone + std::fmt::Debug,
+{
+ pub index: Ix,
+ pub name: String,
+}
+
+impl<Ix> Column<Ix>
+where
+ Ix: Clone + std::fmt::Debug,
+{
+ pub fn new(index: Ix, name: &str) -> Self {
+ Self {
+ index,
+ name: name.to_string(),
+ }
+ }
+}
+
+#[derive(Clone, Debug)]
+pub enum Message {}