module Coco module App module Elements class ConfirmPanel < Coco::Component renders_one :button, ->(**kwargs, &block) do coco_button(theme: :negative, **kwargs, fit: :full, size: :sm, &block) end renders_one :cancel, ->(**kwargs, &block) do coco_button(theme: :secondary, **kwargs, fit: :full, size: :sm, &block) end renders_one :text, Coco::Content before_render do unless button? raise ArgumentError, "No confirmation button defined" end end end end end end