21 lines
589 B
Ruby
21 lines
589 B
Ruby
# frozen_string_literal: true
|
|
|
|
class HeaderTabLinkComponent < ViewComponent::Base
|
|
def initialize(name:, path:, active: false, disabled: false)
|
|
@name = name
|
|
@path = path
|
|
@active = active
|
|
@disabled = disabled
|
|
@link_class = class_names_link(path)
|
|
end
|
|
|
|
def class_names_link(path)
|
|
common = "block md:inline-block px-5 py-2 rounded-md font-medium text-base md:text-xl"
|
|
if @active
|
|
"#{common} bg-gray-900/50 text-white"
|
|
else
|
|
"#{common} text-gray-300 hover:bg-gray-900/30 hover:text-white active:bg-gray-900/30 active:text-white"
|
|
end
|
|
end
|
|
end
|