hac-client 0.2.0

your handy API client, on your terminal!
Documentation
use crossterm::event::KeyEvent;
use ratatui::{layout::Rect, widgets::Paragraph, Frame};

use crate::pages::{Eventful, Renderable};

#[derive(Debug)]
pub struct AuthEditor<'ae> {
    _colors: &'ae hac_colors::colors::Colors,
}

impl<'ae> AuthEditor<'ae> {
    pub fn new(colors: &'ae hac_colors::colors::Colors) -> Self {
        AuthEditor { _colors: colors }
    }
}

impl Renderable for AuthEditor<'_> {
    fn draw(&mut self, frame: &mut Frame, size: Rect) -> anyhow::Result<()> {
        frame.render_widget(Paragraph::new("hello from auth editor").centered(), size);

        Ok(())
    }
}

impl Eventful for AuthEditor<'_> {
    type Result = ();

    fn handle_key_event(&mut self, _key_event: KeyEvent) -> anyhow::Result<Option<Self::Result>> {
        Ok(None)
    }
}