use clay_layout::{
    Clay, Declaration, grow,
    layout::{LayoutDirection, Padding},
    render_commands::RenderCommand,
};
use document::{Document, State, line::Theme};

pub mod document;

pub struct GUI {
    pub document: Document,
}

impl GUI {
    pub fn new() -> Self {
        Self {
            document: Document::new(),
        }
    }

    pub fn render<'a>(
        &'a mut self,
        clay: &'a Clay,
        state: &'a State,
        theme: &'a Theme,
    ) -> impl Iterator<Item = RenderCommand> {
        clay.begin();

        self.document.render(clay, state, theme);

        clay.end()
    }
}
