class Avo::Sidebar::LinkComponent
def classes
def classes "px-4 pr-0 flex-1 flex mx-6 leading-none py-2 text-black rounded font-medium hover:bg-gray-100" end
def initialize(label: nil, path: nil, active: :inclusive, target: nil, data: {})
def initialize(label: nil, path: nil, active: :inclusive, target: nil, data: {}) @label = label @path = path @active = active @target = target @data = data end
def is_external?
def is_external? # If the path contains the scheme, check if it includes the root path or not return !path.include?(Avo::App.root_path) if URI(path).scheme.present? false end
def link_method
def link_method is_external? ? :link_to : :active_link_to end