demarches-normaliennes/app/components/attachment/progress_component.rb
2022-12-05 10:47:10 +01:00

20 lines
391 B
Ruby

class Attachment::ProgressComponent < ApplicationComponent
attr_reader :attachment
def initialize(attachment:)
@attachment = attachment
end
def progress_label
case
when attachment.virus_scanner.pending?
t(".antivirus_pending")
when attachment.watermark_pending?
t(".watermark_pending")
end
end
def render?
progress_label.present?
end
end