2022-11-09 12:33:20 +01:00
|
|
|
class Dsfr::DownloadComponent < ApplicationComponent
|
|
|
|
renders_one :right
|
|
|
|
|
|
|
|
attr_reader :attachment
|
|
|
|
attr_reader :html_class
|
|
|
|
attr_reader :name
|
|
|
|
|
|
|
|
def initialize(attachment:, name: nil)
|
|
|
|
@attachment = attachment
|
|
|
|
@name = name || attachment.filename.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
2022-11-22 19:25:45 +01:00
|
|
|
t(".title", filename: attachment.filename.to_s)
|
2022-11-09 12:33:20 +01:00
|
|
|
end
|
|
|
|
end
|