0f1980b1c3
Closes #9733
22 lines
510 B
Ruby
22 lines
510 B
Ruby
class Attachment::ProgressComponent < ApplicationComponent
|
|
attr_reader :attachment
|
|
attr_reader :ignore_antivirus
|
|
|
|
def initialize(attachment:, ignore_antivirus: false)
|
|
@attachment = attachment
|
|
@ignore_antivirus = ignore_antivirus
|
|
end
|
|
|
|
def progress_label
|
|
case
|
|
when !ignore_antivirus && attachment.virus_scanner.pending?
|
|
t(".antivirus_pending")
|
|
when attachment.watermark_pending?
|
|
t(".watermark_pending")
|
|
end
|
|
end
|
|
|
|
def render?
|
|
progress_label.present?
|
|
end
|
|
end
|