iris-reader 1.0.0

A terminal-native viewer for documents, structured data, images, PDFs, databases, and stdin.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ratatui::text::{Line, Span};

use crate::{search::SearchState, theme::Theme};

pub fn prompt(search: &SearchState, theme: &Theme) -> Line<'static> {
    let count = if search.query.is_empty() {
        String::new()
    } else {
        format!("  {} matches", search.matches.len())
    };
    Line::from(vec![
        Span::styled("/", theme.search_prompt),
        Span::styled(search.query.clone(), theme.document),
        Span::styled("_", theme.search_prompt),
        Span::styled(count, theme.status),
    ])
}