class Lookbook::Button::Component
def before_render
def before_render if dropdown? && id.nil? raise "Dropdown buttons must be given an ID" end end
def button_component
def button_component icon_button? ? IconButton::Component : TextButton::Component end
def dropdown?
def dropdown? dropdown.present? end
def icon_button?
def icon_button? !text_button? && icon end
def initialize(id: nil, icon: nil, **html_attrs)
def initialize(id: nil, icon: nil, **html_attrs) @id = id @icon = icon @button_attrs = html_attrs end
def text_button?
def text_button? content.present? end