WIP Render nostr profile and relay status with Ruby
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
23
app/components/settings/nostr_relay_status_component.rb
Normal file
23
app/components/settings/nostr_relay_status_component.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Settings
|
||||
class NostrRelayStatusComponent < ViewComponent::Base
|
||||
def initialize(relay_urls:)
|
||||
if relay_urls.present?
|
||||
if relay_urls.any? { |r| r.include?("wss://nostr.kosmos.org") }
|
||||
@text = "You have a relay list, and the Kosmos relay is part of it"
|
||||
@icon_name = "check-circle"
|
||||
@icon_color = "emerald-500"
|
||||
else
|
||||
@text = "The Kosmos relay is missing from your relay list"
|
||||
@icon_name = "alert-octagon"
|
||||
@icon_color = "amber-500"
|
||||
end
|
||||
else
|
||||
@text = "We could not find a relay list for your public key"
|
||||
@icon_name = "alert-octagon"
|
||||
@icon_color = "amber-500"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user