# 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