2023-04-18 18:06:24 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Instructeurs::EnConstructionMenuComponent < ApplicationComponent
|
|
|
|
attr_reader :dossier
|
|
|
|
|
|
|
|
def initialize(dossier:)
|
|
|
|
@dossier = dossier
|
|
|
|
end
|
|
|
|
|
|
|
|
def render?
|
|
|
|
return true if dossier.may_repasser_en_construction?
|
|
|
|
return true if dossier.may_flag_as_pending_correction?
|
|
|
|
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def menu_label
|
2023-06-06 14:41:47 +02:00
|
|
|
if !dossier.may_repasser_en_construction?
|
2023-04-18 18:06:24 +02:00
|
|
|
t('.request_correction')
|
|
|
|
else
|
|
|
|
t(".revert_en_construction")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|