use crate::{frontend::components::Component, io::serial::Serial};

impl Component for Serial {
    fn title(&self) -> &str {
        "Serial"
    }

    fn visible(&mut self) -> &mut bool {
        &mut self.visible
    }

    fn ui(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
        self.update();

        ui.label(String::from_utf8(self.buffer.clone()).unwrap());
    }
}
