endpoint-validator 0.1.0

Interactive test harness for endpoint-libs WebSocket RPC services: reads the endpoint description generated by endpoint-gen and exercises every endpoint with preset parameters.
Documentation
use ratatui::{
    style::{Color, Modifier, Style},
    text::Span,
    widgets::{Block, Borders, Paragraph},
};

pub fn create_button<'a>(label: &'a str, is_active: bool, is_focused: bool) -> Paragraph<'a> {
    let style = if is_active {
        Style::default()
            .fg(Color::Gray)
            .bg(Color::Green)
            .add_modifier(Modifier::BOLD)
    } else {
        Style::default().fg(Color::Gray).bg(Color::DarkGray)
    };

    let block = Block::default()
        .borders(Borders::ALL)
        .border_style(Style::default().fg(if is_focused {
            Color::Yellow
        } else {
            Color::Gray
        }));

    Paragraph::new(Span::styled(label, style))
        .alignment(ratatui::layout::Alignment::Center)
        .block(block)
}