Sha256: c89bc9e2bba9ab0fef6b64900be84e636553cdc23762e2c2b57d4c71ccd5a332

Contents?: true

Size: 354 Bytes

Versions: 1

Compression:

Stored size: 354 Bytes

Contents

# frozen_string_literal: true

class Alveole::Sidebar::ItemComponent < ViewComponent::Base
  def initialize(title:, icon: nil, href:, active: false)
    @title = title
    @icon = icon
    @href = href
    @active = active
    @current = @active
  end

  def before_render
    if @active == false
      @current = request.path == @href
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alveole-1.0.0.pre.alpha.1 app/components/alveole/sidebar/item_component.rb