demarches-normaliennes/app/components/attachment/progress_component.rb

21 lines
400 B
Ruby
Raw Normal View History

class Attachment::ProgressComponent < ApplicationComponent
attr_reader :attachment
def initialize(attachment:)
@attachment = attachment
end
def progress_label
case
when attachment.virus_scanner.pending?
"Analyse antivirus en cours…"
when attachment.watermark_pending?
"Traitement en cours…"
end
end
def render?
progress_label.present?
end
end