mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
10 lines
292 B
Ruby
10 lines
292 B
Ruby
# frozen_string_literal: true
|
|
|
|
class MultipleCheckedSelectComponent < ViewComponent::Base
|
|
def initialize(name:, options:, selected:)
|
|
@name = name
|
|
@options = options.map { |option| [option[0], option[1].to_sym] }
|
|
@selected = selected.nil? ? [] : selected.map(&:to_sym)
|
|
end
|
|
end
|