flowrs-tui 0.1.15

Flowrs is a Terminal User Interface (TUI) for Apache Airflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ratatui::{
    style::Style,
    text::{Line, Span},
};

use super::constants::{AirflowStateColor, DEFAULT_STYLE};

pub fn create_headers<'a>(
    headers: impl IntoIterator<Item = &'a str>,
) -> impl Iterator<Item = Line<'a>> {
    headers
        .into_iter()
        .map(|h| Line::from(h).style(DEFAULT_STYLE).centered())
}

pub fn state_to_colored_square<'a>(color: AirflowStateColor) -> Span<'a> {
    Span::styled("", Style::default().fg(color.into()))
}