2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-20 17:50:05 +01:00
|
|
|
class Dsfr::SidemenuComponent < ApplicationComponent
|
|
|
|
renders_many :links, "LinkComponent"
|
|
|
|
|
|
|
|
class LinkComponent < ApplicationComponent
|
2023-04-24 15:13:51 +02:00
|
|
|
attr_reader :name, :url, :icon
|
|
|
|
def initialize(name:, url:, icon: nil)
|
2023-03-20 17:50:05 +01:00
|
|
|
@name = name
|
|
|
|
@url = url
|
2023-04-24 15:13:51 +02:00
|
|
|
@icon = icon
|
2023-03-20 17:50:05 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def active?(url)
|
|
|
|
current_page?(url)
|
|
|
|
end
|
|
|
|
end
|