gitlab-org--gitlab-foss/spec/components/previews/pajamas/alert_component_preview.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
546 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Pajamas
class AlertComponentPreview < ViewComponent::Preview
# @param body text
# @param dismissible toggle
# @param variant select [info, warning, success, danger, tip]
def default(body: nil, dismissible: true, variant: :info)
render(Pajamas::AlertComponent.new(
title: "Title",
dismissible: dismissible,
variant: variant.to_sym
)) do |c|
if body
c.with_body { body }
end
end
end
end
end