# frozen_string_literal: true module Settings class NostrEditProfileComponent < ViewComponent::Base def initialize(user:, profile_event:) @user = user @profile_event = profile_event @profile = {} @display_name = nil if profile_event.present? && profile_event["content"].present? @profile = JSON.parse(profile_event["content"]) rescue {} @display_name = @profile["display_name"] || @profile["displayName"] end end end end