Class: Solrengine::Ui::NetworkBadgeComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Solrengine::Ui::NetworkBadgeComponent
- Defined in:
- app/components/solrengine/ui/network_badge_component.rb
Constant Summary collapse
- NETWORKS =
{ "mainnet-beta" => { label: "Mainnet", dot_color: "bg-green-500" }, "devnet" => { label: "Devnet", dot_color: "bg-yellow-500" }, "testnet" => { label: "Testnet", dot_color: "bg-blue-500" } }.freeze
Instance Attribute Summary collapse
-
#network ⇒ Object
readonly
Returns the value of attribute network.
Instance Method Summary collapse
- #dot_color ⇒ Object
-
#initialize(network:) ⇒ NetworkBadgeComponent
constructor
A new instance of NetworkBadgeComponent.
- #label ⇒ Object
Constructor Details
#initialize(network:) ⇒ NetworkBadgeComponent
Returns a new instance of NetworkBadgeComponent.
14 15 16 |
# File 'app/components/solrengine/ui/network_badge_component.rb', line 14 def initialize(network:) @network = network end |
Instance Attribute Details
#network ⇒ Object (readonly)
Returns the value of attribute network.
12 13 14 |
# File 'app/components/solrengine/ui/network_badge_component.rb', line 12 def network @network end |
Instance Method Details
#dot_color ⇒ Object
22 23 24 |
# File 'app/components/solrengine/ui/network_badge_component.rb', line 22 def dot_color network_config[:dot_color] end |
#label ⇒ Object
18 19 20 |
# File 'app/components/solrengine/ui/network_badge_component.rb', line 18 def label network_config[:label] end |