Class: Panda::Core::Admin::EmptyStateComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/panda/core/admin/empty_state_component.rb

Overview

Empty state component for tables and lists.

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, description: nil, icon: nil, **attrs) ⇒ EmptyStateComponent

Returns a new instance of EmptyStateComponent.



8
9
10
11
12
13
# File 'app/components/panda/core/admin/empty_state_component.rb', line 8

def initialize(title:, description: nil, icon: nil, **attrs)
  @title = title
  @description = description
  @icon = icon
  super(**attrs)
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



15
16
17
# File 'app/components/panda/core/admin/empty_state_component.rb', line 15

def description
  @description
end

#iconObject (readonly)

Returns the value of attribute icon.



15
16
17
# File 'app/components/panda/core/admin/empty_state_component.rb', line 15

def icon
  @icon
end

#titleObject (readonly)

Returns the value of attribute title.



15
16
17
# File 'app/components/panda/core/admin/empty_state_component.rb', line 15

def title
  @title
end

Instance Method Details

#default_attrsObject



17
18
19
20
21
# File 'app/components/panda/core/admin/empty_state_component.rb', line 17

def default_attrs
  {
    class: "border-2 border-dashed border-gray-200 bg-white rounded-2xl px-6 py-10 text-center"
  }
end