refactor(attachment): extract PendingPoll component

This commit is contained in:
Colin Darie 2022-11-23 12:54:09 +01:00
parent b110e58f2f
commit 42363e0b0d
13 changed files with 109 additions and 83 deletions

View file

@ -27,11 +27,10 @@
- if !as_multiple?
= file_field(champ, field_name, **file_field_options)
- if in_progress?
%div{ data: poll_controller_options }
- if attachment.created_at < 30.seconds.ago
.fr-mt-2w
= render Attachment::LongProcessingRefreshComponent.new(attachment: attachment)
- if persisted?
- Attachment::PendingPollComponent.new(attachment: attachment, poll_url:).then do |component|
.fr-mt-2w
= render component
.attachment-error.hidden
%p.fr-error-text= t('.errors.uploading')