use bucket_name_and_balance::BucketNameAndBalance; use iced::Element; use schist_models::Bucket; use crate::gui::components::navigation; mod bucket_name_and_balance; #[derive(Clone, Debug, PartialEq)] pub struct BucketNavigationEntry(BucketNameAndBalance); impl BucketNavigationEntry { pub fn from_bucket(bucket: &Bucket) -> Self { Self(BucketNameAndBalance::new(bucket)) } pub fn to_string(&self) -> String { self.0.bucket.name.clone() } } impl<'a> From<&'a BucketNavigationEntry> for Element<'a, navigation::Message> { fn from(bucket_navigation_entry: &'a BucketNavigationEntry) -> Self { (&bucket_navigation_entry.0).into() } }