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

21 lines
391 B
Ruby
Raw Permalink 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?
2022-11-22 19:25:45 +01:00
t(".antivirus_pending")
when attachment.watermark_pending?
2022-11-22 19:25:45 +01:00
t(".watermark_pending")
end
end
def render?
progress_label.present?
end
end