2022-11-22 15:47:28 +01:00
|
|
|
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")
|
2022-11-22 15:47:28 +01:00
|
|
|
when attachment.watermark_pending?
|
2022-11-22 19:25:45 +01:00
|
|
|
t(".watermark_pending")
|
2022-11-22 15:47:28 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def render?
|
|
|
|
progress_label.present?
|
|
|
|
end
|
|
|
|
end
|