extern crate alloc;
use tui_orchestrator::component::{Component, ComponentAction};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
enum TestFocus {
FieldA,
FieldB,
ButtonC,
}
#[derive(Debug, Clone)]
enum TestEvent {
ButtonCPressed,
TextTyped(char),
}
struct TestComponent {
field_a: alloc::string::String,
field_b: alloc::string::String,
}
impl Component for TestComponent {
type Focus = TestFocus;
type Action = ComponentAction;
type Event = TestEvent;
fn targets(&self) -> &[Self::Focus] {
&[
Self::Focus::FieldA,
Self::Focus::FieldB,
Self::Focus::ButtonC,
]
}
fn handle(
&mut self,
focus: &Self::Focus,
action: Self::Action,
) -> Result