app/components/show/copyright_component.rb
# frozen_string_literal: true
module Show
class CopyrightComponent < ApplicationComponent
def initialize(presenter:)
@presenter = presenter
end
def copyright
change_set.copyright || 'Not entered'
end
def edit?
!version_or_user_version_view? && open_and_not_assembling?
end
delegate :version_service, :version_or_user_version_view?, :change_set, to: :@presenter
delegate :open_and_not_assembling?, to: :version_service
delegate :id, to: :change_set
end
end