Class: Solrengine::Ui::NetworkBadgeComponent

Inherits:
ViewComponent::Base
  • Object
show all
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

Instance Method Summary collapse

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

#networkObject (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_colorObject



22
23
24
# File 'app/components/solrengine/ui/network_badge_component.rb', line 22

def dot_color
  network_config[:dot_color]
end

#labelObject



18
19
20
# File 'app/components/solrengine/ui/network_badge_component.rb', line 18

def label
  network_config[:label]
end