use crate::{elements::Element, widget_factory::WidgetBuilder};
use gtk4::{Widget, prelude::*};

impl WidgetBuilder {
    pub(super) fn create_quote(&self, element: Element) -> Widget {
        if element.is_container() {
            let widget = self.build_element(element);
            widget.add_css_class("card");
            widget.set_margin_bottom(10);
            widget.set_margin_top(10);
            widget
        } else {
            let widget = self.build_element(element);

            libadwaita::Bin::builder()
                .css_classes(["card"])
                .margin_bottom(10)
                .margin_top(10)
                .child(&widget)
                .build()
                .upcast()
        }
    }
}
