2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-16 17:21:10 +02:00
|
|
|
class Procedure::NoticeComponent < ApplicationComponent
|
|
|
|
def initialize(procedure:)
|
|
|
|
@procedure = procedure
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def render?
|
|
|
|
link? || attachment?
|
|
|
|
end
|
|
|
|
|
|
|
|
def link?
|
|
|
|
@procedure.lien_notice.present?
|
|
|
|
end
|
|
|
|
|
|
|
|
def url
|
|
|
|
@procedure.lien_notice
|
|
|
|
end
|
|
|
|
|
|
|
|
def attachment?
|
|
|
|
@procedure.notice.present?
|
|
|
|
end
|
|
|
|
|
|
|
|
def attachment
|
|
|
|
@procedure.notice
|
|
|
|
end
|
|
|
|
end
|