Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

598 B
Raw Blame
# frozen_string_literal: true

class ObjektNavigationComponent < ApplicationComponent
  def initialize(object_class:, headers:, object_values:, object_list:, selected_object:, line_action:, list_action:)
    @object_class = object_class,
                    @headers = headers
    @object_values = object_values
    @object_list = object_list
    @selected_object = selected_object
    @line_action = line_action
    @list_action = list_action
  end

  def line_action_for(object)
    if @line_action.respond_to?(:call)
      @line_action.call(object)
    else
      @line_action
    end
  end
end