summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs
diff options
context:
space:
mode:
Diffstat (limited to 'schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs')
-rw-r--r--schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs b/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs
new file mode 100644
index 0000000..fa2dcac
--- /dev/null
+++ b/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs
@@ -0,0 +1,24 @@
+use iced::{
+ widget::{row, text},
+ Element,
+};
+use schist_models::bucket::Bucket;
+
+use crate::gui::components::navigation;
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct BucketNameAndBalance {
+ pub bucket: Bucket,
+}
+
+impl BucketNameAndBalance {
+ pub fn new(bucket: Bucket) -> Self {
+ Self { bucket }
+ }
+}
+
+impl<'a> Into<Element<'a, navigation::Message<BucketNameAndBalance>>> for BucketNameAndBalance {
+ fn into(self) -> Element<'a, navigation::Message<BucketNameAndBalance>> {
+ row![text(self.bucket.name.clone()), text(self.bucket.balance)].into()
+ }
+}