aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets/session.rs
blob: 55cca56aaba86985f17da43ad6549fbbb6d88c43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use std::collections::BTreeMap;

use super::widget::Widget;

pub struct SessionWidget {}

impl SessionWidget {
    pub fn new(_config: BTreeMap<String, String>) -> Self {
        Self {}
    }
}

impl Widget for SessionWidget {
    fn process(&self, state: crate::ZellijState) -> String {
        let session = state
            .sessions
            .into_iter()
            .find(|s| s.is_current_session);

        match session {
            Some(s) => s.name,
            None => "".to_string(),
        }
    }
}