Class: Charming::Presentation::Components::EmptyState
- Inherits:
-
Charming::Presentation::Component
- Object
- View
- Charming::Presentation::Component
- Charming::Presentation::Components::EmptyState
- Defined in:
- lib/charming/presentation/components/empty_state.rb
Instance Method Summary collapse
-
#initialize(message: "Nothing to show.", loading: false, loading_message: "Loading...", error: nil, error_message: nil, help: nil, theme: nil) ⇒ EmptyState
constructor
A new instance of EmptyState.
- #render ⇒ Object
Methods inherited from View
Constructor Details
#initialize(message: "Nothing to show.", loading: false, loading_message: "Loading...", error: nil, error_message: nil, help: nil, theme: nil) ⇒ EmptyState
Returns a new instance of EmptyState.
7 8 9 10 11 12 13 14 15 |
# File 'lib/charming/presentation/components/empty_state.rb', line 7 def initialize(message: "Nothing to show.", loading: false, loading_message: "Loading...", error: nil, error_message: nil, help: nil, theme: nil) super(theme: theme) @message = @loading = loading @loading_message = @error = error @error_message = @help = help end |
Instance Method Details
#render ⇒ Object
17 18 19 20 21 22 |
# File 'lib/charming/presentation/components/empty_state.rb', line 17 def render return loading_state if @loading return error_state if error? text @message, style: theme.muted end |