2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-06-05 17:36:25 +02:00
|
|
|
class Dossiers::InvalidIneligibiliteRulesComponent < ApplicationComponent
|
2024-06-05 19:16:41 +02:00
|
|
|
delegate :can_passer_en_construction?, to: :@dossier
|
2024-06-05 17:36:25 +02:00
|
|
|
|
|
|
|
def initialize(dossier:)
|
|
|
|
@dossier = dossier
|
|
|
|
@revision = dossier.revision
|
|
|
|
end
|
|
|
|
|
|
|
|
def render?
|
2024-06-05 19:16:41 +02:00
|
|
|
!can_passer_en_construction?
|
2024-06-05 17:36:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def error_message
|
|
|
|
@dossier.revision.ineligibilite_message
|
|
|
|
end
|
|
|
|
end
|