File: empty_state_component.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (29 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
- empty_state_class = @compact ? 'gl-flex-row' : 'gl-text-center gl-flex-col'

%section.gl-flex.gl-empty-state{ **@empty_state_options, class: empty_state_class }
  - if @svg_path.present?
    - image_class = @compact ? 'gl-hidden sm:gl-block gl-px-4' : 'gl-max-w-full'
    %div{ class: image_class }
      = image_tag @svg_path, alt: "", class: 'gl-dark-invert-keep-hue'

  - content_wrapper_class = @compact ? 'gl-grow gl-basis-0 gl-px-4' : 'gl-m-auto gl-p-5'
  .gl-empty-state-content.gl-mx-auto.gl-my-0{ class: content_wrapper_class }
    - title_class = @compact ? 'h5' : 'h4'
    %h1.gl-text-size-h-display.gl-leading-36.gl-mt-0.gl-mb-0{ class: title_class }
      = @title

    - if description?
      %p.gl-mt-4.gl-mb-0{ 'data-testid': 'empty-state-description' }
        = description

    - if @primary_button_text.present? || @secondary_button_text.present?
      - button_wrapper_class = @compact.present? ? '' : 'gl-justify-center'
      .gl-flex.gl-flex-wrap.gl-mt-5.gl-gap-3{ class: button_wrapper_class }

        - if @primary_button_text.present?
          = render Pajamas::ButtonComponent.new(variant: :confirm, href: @primary_button_link, button_options: { class: '!gl-ml-0', **@primary_button_options }) do
            = @primary_button_text

        - if @secondary_button_text.present?
          = render Pajamas::ButtonComponent.new(variant: :default, href: @secondary_button_link, button_options: { class: ('!gl-ml-0' unless @primary_button_text.present?), **@secondary_button_options }) do
            = @secondary_button_text