use iced::Element; use schist_models::Account; use crate::{ gui::components::{navigation, Text}, impl_focusable, }; #[derive(Clone, Debug, PartialEq)] pub struct AccountNavigationEntry { pub account: Account, is_focused: bool, } impl AccountNavigationEntry { pub fn new(account: Account) -> Self { Self { account, is_focused: false, } } } impl<'a> From<&'a AccountNavigationEntry> for Element<'a, navigation::Message> { fn from(account_navigation_entry: &'a AccountNavigationEntry) -> Self { Text::default(&account_navigation_entry.account.name) .highlight_maybe(account_navigation_entry.is_focused) .into() } } impl_focusable!(AccountNavigationEntry);